diff --git a/README.md b/README.md index 337b7e5..742f753 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,79 @@ -# simplyOpen - -Theme for static website generator pelican inspired by pelican-simplegrey, but without all the datadealer (Google, Twitter, Facebook) stuff. \ No newline at end of file +## simplyOpen ## + +## Screenshot ## + +![screenshot](screenshot.png) + + +## Options ## + +Theme inspired by the mkdocs default theme, without all the datadealer (Google, Twitter, Facebook) stuff. [Federation Widget](https://github.com/LubuWest/federation-widget) in sidebar (works currently only with Friendica). Social links to Mastodon, Matrix, Friendica, Diaspora, Misskey,... +EMail and License is displayed in the footer. + +Javascript only used for Federation Widget. + +Configuration in pelicanconf.py: +``` + EMAIL='x@y.com' + + SOCIAL = (('Diaspora', 'https://diasp.eu/...'), + ('Friendica', 'https://friendica.eu/profile/...'), + ('Forgejo', 'https://codeberg.org...'), + ('Funkwhale', 'https://abc.de/...'), + ('Gitea', 'https://abc.de/...'), + ('Github', 'https://github.com/...'), + ('Gitlab', 'https://gitlab.com/...'), + ('Gnusocial', 'https://www.gnusocial.no/...'), + ('Hubzilla', 'https://abc.de/...'), + ('Mastodon', 'https://mastodon.social/...'), + ('Matrix', 'https://mastodon.social/...'), + ('Misskey', 'https://misskey.com/...'), + ('Movim', 'https://pod.movim.eu/?q=...'), + ('Peertube', 'https://peertube.com/'), + ('Pixelfed', 'https://pixelfed.com/...'), + ('Pleroma', 'https://pleroma.com/...'), + ('Pixelfed', 'https://pixelfed.com/...'), + ('Plume', 'http://plume.come/'), + ('Pixelfed', 'https://pixelfed.com/...'), + ('Pump.io', 'https://pump.io/...'), + ('RedMatrix', 'https://red.com/...'), + ('XMPP', 'abc@jabber.de')) + + # License (choose one) + LICENSE = 'CC-BY-SA', 'CC-BY', 'CC-BY-NC', 'CC-BY-NC-SA', 'ALL RIGHTS RESERVED' + + FEDERATION_TIMELINE = (('domain','https://loma.ml'), # CORS headers must be set at the Friendica server, add the following to .htaccess + # Header add Access-Control-Allow-Origin "https://myblog.com" + # Header add Access-Control-Allow-Methods: "GET" + + ('user','startrek'), + ('max','5'), + ('type','user'), # could be 'group' to follow a group + ('servertype','friendica'),) # could be 'diaspora', 'friendica' or 'hubzilla' +``` + +## Project documentation ## +For displaying project Markdown files as website similar to mkdocs, additional parameters should be set: + +``` +CATEGORIES_ON_SIDEBAR = 'left' # 'right' or 'none' +# If 'left', directory names are used as menu button. If files are not in subdirectories, filenames are used + +FILENAME_METADATA = '(?P.*)' # to retrieve the title from filename, if there is no Title field in te Markdown file + +DEFAULT_DATE = 'fs' # to retrieve the date from file savedate of file, if there is no Date field in te Markdown file +# last saved file will be used as the start page of the website + +STATIC_PATHS = ['Screenshots'] # place of image files should be set + +SITEDESCRIPTION = 'Lorem ipsum dolor sit ..' # Additional text shown on the start page + +DISPLAY_PAGES_ON_MENU = True # Markdown files in the 'pages' directory are shown as links in the header +``` + +## Credits ## +* Icons copyright by their respective owners + +## License ## +In line with Federation Widget (https://github.com/LubuWest/federation-widget) this template is under the [WTF Public License](http://sam.zoy.org/wtfpl/COPYING). + diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..ba846cb Binary files /dev/null and b/screenshot.png differ diff --git a/static/css/main.css b/static/css/main.css new file mode 100644 index 0000000..30de229 --- /dev/null +++ b/static/css/main.css @@ -0,0 +1,484 @@ +/* +Colors : +- #40403F +- #4D4D4C +- #7F7F7E +- #E5E5E3 +- #F0F0F0 +*/ + +/* Imports */ + +@import url("pygment.css"); + + +/* Layout */ + +article, +figcaption, +figure, +footer, +header, +nav, +section{ + display: block; +} + +html { + font-size: 100%; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} + +body { + font-family: 'Verdana', sans-serif; + font-size: 16px; + line-height: 150%; + text-align: left; + padding: 0; + margin: 0; +} + +header { + margin:0 +} + +[role=banner]{ + background-image: linear-gradient(#54b4eb, #2FA4E7 60%, #1d9ce5); + height: auto; /*50px;*/ + line-height: 50px; + padding: 0 1%; + position: fixed; + width: 100%; + margin: 0; + +} + +.wrapper { + margin-top: 0; + padding: 50px 0 0 0; + display:flex; + flex-flow: row wrap; + width: 100%; +} + +.content { + border-left: 1px solid #d6d6d6; + border-right: 1px dotted #D6D6D6; + padding: 0 20px 1em 20px; + width: calc(70% - 50px - 10em); + overflow: auto; +} + +.sidebar { + width: 30%; + border-right: 1px solid #d6d6d6; + padding: 0 10px 1em 0; +} + +.left-sidebar { + min-width: 8em; + width: 8em; + border-right: 1px solid #d6d6d6; + padding: 0 10px 1em 10px; + height: inherit; + overflow: auto; +} + +.left-sidebar nav { + position:fixed; +} + +.left-sidebar ul { + list-style-type: none; + padding:0; +} + +.left-sidebar li a{ + display: block; + text-decoration: none; +} + +.left-sidebar li a.active{ + background-color: #4CAF50; + color: white; +} + +.left-sidebar li a.:hover:not(.active){ + background-color: #555; + color: white; +} + + +footer { + border-top: 1px dotted #D6D6D6; + line-height: 80%; + padding: 0 1em; + font-size: 0.8em; +} + + +/* Header */ + +header a { + color: #E5E5E3; + border-bottom: none; +} + +header a.title { + font-size: 2em; +} + +header .feeds { + float: right; + text-align: right; + width: 25%; + height: 41px; + padding-top: 9px; + padding-right: 9px; +} + +header .feeds a { + display: block; + float: right; + padding-right: 5px; + width: 40px; +} + +header .feeds a:hover, +header .feeds a:active { + border-bottom: none; +} + +header .pages { + float: right; +} + +header .pages a { + font-size: 1.1em; +} + + +/* Sidebar */ + +/* Titles */ + +h1, h2, h3, h4, h5, h6 { + font-family: "Verdana",sans-serif; + font-weight: 400; + text-shadow: 0.1em 0.1em 0.1em #EFEFEF; + line-height: 125%; +} + +h1 { + font-size: 2em; + margin: 0.67em 0; + padding: 0.7em 0 0.3em; +} + +h1 a { + color: inherit; + border-bottom: none; +} + + +/* Texts */ + +p { + margin: 0.8em 0 0.5em; +} + +a { + text-decoration: none; + border-bottom: 1px dotted #4D4D4C; + color: #4D4D4C; +} + +a:hover, a:active { + text-decoration: none; + border-bottom: 1px dotted #4271AE; + color: #4271AE; +} + +.literal { + font-size: 0.9em; + border: 1px solid #F0F0F0; + padding: 0px 5px; +} + +pre { + font-family: 'Verdana',monospace; + background: none repeat scroll 0 0 #F0F0F0; + border-radius: 2px; + font-size: 0.9em; + font-style: normal; + letter-spacing: 0.015em; + line-height: 130%; + padding: 0.7em; + white-space: pre-wrap; + word-wrap: break-word; +} + +hr { + margin: 40px 5% 60px 5%; + color: #d6d6d6; + box-shadow: 0.1em 0.1em 0.1em #EFEFEF; + border-radius: 5px; +} + + +/* Article */ + +article.summary { + margin-bottom: 40px; + clear: both; +} + +article.full .metadata, +article.summary .metadata { + font-style: italic; +} + +.metadata p { + margin: 0; +} +*/ +/* Listings */ + +ol.archive li { + margin: 8px 0; +} + +ol.archive li time, +ol.archive li .tags + { + line-height: 140%; + font-size: 0.8em; + margin: 0; +} + + +/* Social */ + +.social { + list-style-type: none; + padding-left: 0px; +} + +.social li { + clear: both; +} + +.social a {} + +.social i { + float: left; + margin-right: 3px; + padding-top: 4px; +} +.social a[id*='Buddycloud'] + i:before {content: url('../images/icons/buddycloud-18px.png'); } +.social a[id*='Diaspora'] + i:before {content: url('../images/icons/Diaspora-18px.png'); } +.social a[id*='Friendica'] + i:before {content: url('../images/icons/friendica-18px.png'); } +.social a[id*='Forgejo'] + i:before {content: url('../images/icons/forgejo-18px.png'); } +.social a[id*='Funkwhale'] + i:before {content: url('../images/icons/funkwhale-16.png'); } +.social a[id*='Gitea'] + i:before {content: url('../images/icons/gitea-18px.png'); } +.social a[id*='Github'] + i:before {content: url('../images/icons/github-18px.png'); } +.social a[id*='Gitlab'] + i:before {content: url('../images/icons/gitlab-18px.png'); } +.social a[id*='Gnusocial'] + i:before {content: url('../images/icons/gnusocial-18px.png'); } +.social a[id*='Hubzilla'] + i:before {content: url('../images/icons/hubzilla-16.png'); } +.social a[id*='Mastodon'] + i:before {content: url('../images/icons/mastodon-18px.png'); } +.social a[id*='Matrix'] + i:before {content: url('../images/icons/matrix-16.png'); } +.social a[id*='Misskey'] + i:before {content: url('../images/icons/misskey-18px.png'); } +.social a[id*='Movim'] + i:before {content: url('../images/icons/movim-18px.png'); } +.social a[id*='Peertube'] + i:before {content: url('../images/icons/peertube-18px.png'); } +.social a[id*='Pixelfed'] + i:before {content: url('../images/icons/pixelfed-18px.png'); } +.social a[id*='Pleroma'] + i:before {content: url('../images/icons/pleroma-18px.png'); } +.social a[id*='Plume'] + i:before {content: url('../images/icons/plume-16.png'); } +.social a[id*='Pump.io'] + i:before {content: url('../images/icons/pumpio-18px.png'); } +.social a[id*='RedMatrix'] + i:before {content: url('../images/icons/redmatrix-18px.png'); } +.social a[id*='XMPP'] + i:before {content: url('../images/icons/xmpp-18px.png'); } +.social a[href*='rss.xml']:before {content: url('../images/icons/feed-18px.png'); } +.social a[href*='atom.xml']:before {content: url('../images/icons/feed-18px.png'); } + + +/* Tag cloud */ + +ul.tagcloud { + list-style: none; + padding: 0; + width: 90%; + margin: 0 auto; + line-height: 200%; +} + +ul.tagcloud li { + display: inline-block; +} + +li.tag-1 { font-size: 100%; margin: 0 1em; } +li.tag-2 { font-size: 80%; margin: 0 1em; } +li.tag-3 { font-size: 70%; margin: 0 1em; } +li.tag-4 { font-size: 60%; margin: 0 1em; } + +/* Pagination */ + +.pagination { + width: 100px; + margin: 1em auto; +} + +/* Federation Social Widget */ +#federation_widget { +font-size: 0.7em; +margin-top: 20px; +height: 350px; +width: 230px; +padding: 0; +border-radius: 5px; +background-color: #FcFcFc; +overflow-y: auto; +} + +#federation_widget header { +padding-bottom: 8px; +text-align: left; +font-size: 1.5em; +border-bottom: 3px solid #EEEEEE; +background-color: #FcFcFc; +border-top-left-radius: 5px; +border-top-right-radius: 5px; +} + +#federation_widget header a { +text-decoration: none; +color:black +} + +#federation_widget header img { +margin: 5px; +background-color: #ffffff; +border-radius: 5px; +float: left; +max-width: 50px; +} + +#federation_widget header p { +margin: 0px; +line-height: 60px; +} + +#federation_widget article { +display: block; +margin-bottom: 5px; +padding: 5px; +border-bottom: thin solid #eeeeee; +overflow: hidden; /* For too long link: hide but enable click on it */ +} + +#federation_widget article img { +margin: 5px; +max-width: 230px; +} + +#federation_widget article p { +margin-top: 0px; +} + +.groupmember img { +border-radius: 5px; +} + +.tooltip {position: relative;} +.tooltip span {display: none;} +.tooltip:hover span { +display: block; +position: absolute; +left: 0; top: 10%; +margin: 20px 0 0; +width: 200px; +font-size: 0.7em; +color: #4D4D4C; +border: thin solid #eeeeee; +padding: 4px; +background: white; +} + + + +/* Friendica Comments */ +#comments { + border-top: thin solid #eeeeee; + padding-top: 15px; + display: table; + margin-left: 60px; + width: calc(100% - 60px); +} + +.comment-container { + display: table-cell; + float: right; + min-width: 100%; + padding: 5px; + border-bottom: thin solid #eeeeee; + } + +.contact-photo { + float: left; + width: 60px; + height: 60px; + margin-left: 16px; + margin-right: 16px; +} + +.wall-item-actions-author { + height: 10px; + font-size: 70%; +} +.wall-item-content { + margin-top: 10px; + font-size: 90%; + text-align: left; + } + + +/* Responsive */ + +@media (max-width: 900px) { + + body { + min-width: 300px; + max-width: 600px; + } + + .container { + border-right: none; + } + + .wrapper { + padding: 100px 20px 20px 20px; + float: none; + width: 90%; + } + + .wrapper .sidebar, + .wrapper .left-sidebar, + .wrapper .content { + display: block; + position: static; + padding: 0px 5px 1em; + border-left: none; + border-right: none; + width: 100%; + height: auto; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + + .left-sidebar nav { + position: static; + } + + ul.tagcloud { + margin: 0; + } +} diff --git a/static/css/pygment.css b/static/css/pygment.css new file mode 100644 index 0000000..594b0fa --- /dev/null +++ b/static/css/pygment.css @@ -0,0 +1,205 @@ +.hll { +background-color:#FFFFCC; +} +.c { +color:#408090; +font-style:italic; +} +.err { +border:1px solid #FF0000; +} +.k { +color:#007020; +font-weight:bold; +} +.o { +color:#666666; +} +.cm { +color:#408090; +font-style:italic; +} +.cp { +color:#007020; +} +.c1 { +color:#408090; +font-style:italic; +} +.cs { +background-color:#FFF0F0; +color:#408090; +} +.gd { +color:#A00000; +} +.ge { +font-style:italic; +} +.gr { +color:#FF0000; +} +.gh { +color:#000080; +font-weight:bold; +} +.gi { +color:#00A000; +} +.go { +color:#303030; +} +.gp { +color:#C65D09; +font-weight:bold; +} +.gs { +font-weight:bold; +} +.gu { +color:#800080; +font-weight:bold; +} +.gt { +color:#0040D0; +} +.kc { +color:#007020; +font-weight:bold; +} +.kd { +color:#007020; +font-weight:bold; +} +.kn { +color:#007020; +font-weight:bold; +} +.kp { +color:#007020; +} +.kr { +color:#007020; +font-weight:bold; +} +.kt { +color:#902000; +} +.m { +color:#208050; +} +.s { +color:#4070A0; +} +.na { +color:#4070A0; +} +.nb { +color:#007020; +} +.nc { +color:#0E84B5; +font-weight:bold; +} +.no { +color:#60ADD5; +} +.nd { +color:#555555; +font-weight:bold; +} +.ni { +color:#D55537; +font-weight:bold; +} +.ne { +color:#007020; +} +.nf { +color:#06287E; +} +.nl { +color:#002070; +font-weight:bold; +} +.nn { +color:#0E84B5; +font-weight:bold; +} +.nt { +color:#062873; +font-weight:bold; +} +.nv { +color:#BB60D5; +} +.ow { +color:#007020; +font-weight:bold; +} +.w { +color:#BBBBBB; +} +.mf { +color:#208050; +} +.mh { +color:#208050; +} +.mi { +color:#208050; +} +.mo { +color:#208050; +} +.sb { +color:#4070A0; +} +.sc { +color:#4070A0; +} +.sd { +color:#4070A0; +font-style:italic; +} +.s2 { +color:#4070A0; +} +.se { +color:#4070A0; +font-weight:bold; +} +.sh { +color:#4070A0; +} +.si { +color:#70A0D0; +font-style:italic; +} +.sx { +color:#C65D09; +} +.sr { +color:#235388; +} +.s1 { +color:#4070A0; +} +.ss { +color:#517918; +} +.bp { +color:#007020; +} +.vc { +color:#BB60D5; +} +.vg { +color:#BB60D5; +} +.vi { +color:#BB60D5; +} +.il { +color:#208050; +} diff --git a/static/images/icons/Diaspora-18px.png b/static/images/icons/Diaspora-18px.png new file mode 100644 index 0000000..6a45904 Binary files /dev/null and b/static/images/icons/Diaspora-18px.png differ diff --git a/static/images/icons/Diaspora-32px.png b/static/images/icons/Diaspora-32px.png new file mode 100644 index 0000000..b4f24b5 Binary files /dev/null and b/static/images/icons/Diaspora-32px.png differ diff --git a/static/images/icons/Pleroma_logo.svg.png b/static/images/icons/Pleroma_logo.svg.png new file mode 100644 index 0000000..5ca6e1b Binary files /dev/null and b/static/images/icons/Pleroma_logo.svg.png differ diff --git a/static/images/icons/buddycloud-18px.png b/static/images/icons/buddycloud-18px.png new file mode 100644 index 0000000..4f116a1 Binary files /dev/null and b/static/images/icons/buddycloud-18px.png differ diff --git a/static/images/icons/buddycloud-30px.png b/static/images/icons/buddycloud-30px.png new file mode 100644 index 0000000..41ac9c8 Binary files /dev/null and b/static/images/icons/buddycloud-30px.png differ diff --git a/static/images/icons/feed-18px.png b/static/images/icons/feed-18px.png new file mode 100644 index 0000000..2ce3706 Binary files /dev/null and b/static/images/icons/feed-18px.png differ diff --git a/static/images/icons/feed-32px.png b/static/images/icons/feed-32px.png new file mode 100644 index 0000000..52ce22b Binary files /dev/null and b/static/images/icons/feed-32px.png differ diff --git a/static/images/icons/forgejo-18px.png b/static/images/icons/forgejo-18px.png new file mode 100644 index 0000000..687de0e Binary files /dev/null and b/static/images/icons/forgejo-18px.png differ diff --git a/static/images/icons/friendica-18px.png b/static/images/icons/friendica-18px.png new file mode 100644 index 0000000..3374952 Binary files /dev/null and b/static/images/icons/friendica-18px.png differ diff --git a/static/images/icons/friendica-32.png b/static/images/icons/friendica-32.png new file mode 100644 index 0000000..61764bf Binary files /dev/null and b/static/images/icons/friendica-32.png differ diff --git a/static/images/icons/funkwhale-16.png b/static/images/icons/funkwhale-16.png new file mode 100644 index 0000000..159cee3 Binary files /dev/null and b/static/images/icons/funkwhale-16.png differ diff --git a/static/images/icons/gitea-18px.png b/static/images/icons/gitea-18px.png new file mode 100644 index 0000000..435d4a3 Binary files /dev/null and b/static/images/icons/gitea-18px.png differ diff --git a/static/images/icons/github-18px.png b/static/images/icons/github-18px.png new file mode 100644 index 0000000..6322e4f Binary files /dev/null and b/static/images/icons/github-18px.png differ diff --git a/static/images/icons/github-32px.png b/static/images/icons/github-32px.png new file mode 100644 index 0000000..601293f Binary files /dev/null and b/static/images/icons/github-32px.png differ diff --git a/static/images/icons/gitlab-18px.png b/static/images/icons/gitlab-18px.png new file mode 100644 index 0000000..eb6de85 Binary files /dev/null and b/static/images/icons/gitlab-18px.png differ diff --git a/static/images/icons/gnusocial-18px.png b/static/images/icons/gnusocial-18px.png new file mode 100644 index 0000000..d6b875d Binary files /dev/null and b/static/images/icons/gnusocial-18px.png differ diff --git a/static/images/icons/gnusocial-32px.png b/static/images/icons/gnusocial-32px.png new file mode 100644 index 0000000..d910dd0 Binary files /dev/null and b/static/images/icons/gnusocial-32px.png differ diff --git a/static/images/icons/hubzilla-16.png b/static/images/icons/hubzilla-16.png new file mode 100644 index 0000000..37f467a Binary files /dev/null and b/static/images/icons/hubzilla-16.png differ diff --git a/static/images/icons/mastodon-18px.png b/static/images/icons/mastodon-18px.png new file mode 100644 index 0000000..60ad4c6 Binary files /dev/null and b/static/images/icons/mastodon-18px.png differ diff --git a/static/images/icons/matrix-16.png b/static/images/icons/matrix-16.png new file mode 100644 index 0000000..887eb89 Binary files /dev/null and b/static/images/icons/matrix-16.png differ diff --git a/static/images/icons/misskey-18px.png b/static/images/icons/misskey-18px.png new file mode 100644 index 0000000..92dd6b2 Binary files /dev/null and b/static/images/icons/misskey-18px.png differ diff --git a/static/images/icons/movim-18px.png b/static/images/icons/movim-18px.png new file mode 100644 index 0000000..72772a9 Binary files /dev/null and b/static/images/icons/movim-18px.png differ diff --git a/static/images/icons/peertube-18px.png b/static/images/icons/peertube-18px.png new file mode 100644 index 0000000..6add01a Binary files /dev/null and b/static/images/icons/peertube-18px.png differ diff --git a/static/images/icons/pixelfed-18px.png b/static/images/icons/pixelfed-18px.png new file mode 100644 index 0000000..b5851f0 Binary files /dev/null and b/static/images/icons/pixelfed-18px.png differ diff --git a/static/images/icons/pleroma-18px.png b/static/images/icons/pleroma-18px.png new file mode 100644 index 0000000..9a3856e Binary files /dev/null and b/static/images/icons/pleroma-18px.png differ diff --git a/static/images/icons/plume-16.png b/static/images/icons/plume-16.png new file mode 100644 index 0000000..958520a Binary files /dev/null and b/static/images/icons/plume-16.png differ diff --git a/static/images/icons/pumpio-18px.png b/static/images/icons/pumpio-18px.png new file mode 100644 index 0000000..9471fd3 Binary files /dev/null and b/static/images/icons/pumpio-18px.png differ diff --git a/static/images/icons/redmatrix-18.png b/static/images/icons/redmatrix-18.png new file mode 100644 index 0000000..6818b31 Binary files /dev/null and b/static/images/icons/redmatrix-18.png differ diff --git a/static/images/icons/redmatrix-32.png b/static/images/icons/redmatrix-32.png new file mode 100644 index 0000000..8416edd Binary files /dev/null and b/static/images/icons/redmatrix-32.png differ diff --git a/static/images/icons/xmpp-18px.png b/static/images/icons/xmpp-18px.png new file mode 100644 index 0000000..6d42d5c Binary files /dev/null and b/static/images/icons/xmpp-18px.png differ diff --git a/static/images/licenses/cc-by-88x31.png b/static/images/licenses/cc-by-88x31.png new file mode 100644 index 0000000..76b94c0 Binary files /dev/null and b/static/images/licenses/cc-by-88x31.png differ diff --git a/static/images/licenses/cc-by-nc-88x31.png b/static/images/licenses/cc-by-nc-88x31.png new file mode 100644 index 0000000..70bbb3b Binary files /dev/null and b/static/images/licenses/cc-by-nc-88x31.png differ diff --git a/static/images/licenses/cc-by-nc-sa-88x31.png b/static/images/licenses/cc-by-nc-sa-88x31.png new file mode 100644 index 0000000..4de2222 Binary files /dev/null and b/static/images/licenses/cc-by-nc-sa-88x31.png differ diff --git a/static/images/licenses/cc-by-sa-88x31.png b/static/images/licenses/cc-by-sa-88x31.png new file mode 100644 index 0000000..e0bbe34 Binary files /dev/null and b/static/images/licenses/cc-by-sa-88x31.png differ diff --git a/static/js/federation_widget.js b/static/js/federation_widget.js new file mode 100644 index 0000000..6afb2f2 --- /dev/null +++ b/static/js/federation_widget.js @@ -0,0 +1 @@ +function getAtom(){window.XMLHttpRequest?xmlhttp=new XMLHttpRequest:xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp.open("GET",url,!0),xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState===XMLHttpRequest.DONE)try{(xmlhttp.status=200)&&updateWidget(xmlhttp.responseXML)}catch(t){}},xmlhttp.send()}function updateWidget(t){"hubzilla"==servertype?userinfo=t.getElementsByTagNameNS("http://purl.org/zot","owner")[0]:userinfo=t.getElementsByTagName("author")[0];try{if("hubzilla"==servertype)for(var e=userinfo.getElementsByTagName("link"),a=0;a<e.length;a++)"avatar"==e[a].getAttribute("rel")&&(img=e[a].getAttribute("href"));else img=t.getElementsByTagName("logo")[0].firstChild.data}catch(t){img=""}try{profile=userinfo.getElementsByTagName("uri")[0].firstChild.data}catch(t){profile=""}try{displayname=userinfo.getElementsByTagName("name")[0].firstChild.data}catch(t){displayname=""}content='<div id="federation_widget"><header>',""!=img&&(content+='<a target= "_blank" href="'+profile+'"><img src="'+img+'" title="Avatar"/></a>'),content+=' <p><a target= "_blank" href="'+profile+'">'+displayname+"</a></p></header>";for(var r=t.getElementsByTagName("entry"),n=max-1,l=0;l<r.length;l++){try{var i="",s="",o="",m="";if("group"==type){s=r[l].getElementsByTagName("author")[0].getElementsByTagNameNS("http://portablecontacts.net/spec/1.0","displayName")[0].firstChild.data;var g=r[l].getElementsByTagName("link");for(a=0;a<g.length;a++)if("avatar"==g[a].getAttribute("rel"))o=g[a].getAttribute("href");i='<span class="groupmember"><a class="tooltip" target= "_blank" href="'+(m=r[l].getElementsByTagName("uri")[0].firstChild.data)+'"><img style="max-width:50px;" alt="Profile" align="left" src="'+o+'" />'+s+" <span>"+m+"</span> </a> </span>"}}catch(t){i="",o="",m=""}try{var p=r[l].getElementsByTagName("content")[0].firstChild.data}catch(t){p=""}try{var d="";d=new Date(r[l].getElementsByTagName("updated")[0].firstChild.data).toLocaleString(),d='<span class="tooltip">⌛<span>'+posttime_label+" "+d+"</span> </span>"}catch(t){d=""}content+="<article>"+i+d+"<br />"+p+"</article>",n<r.length&&l==n&&(l=r.length)}content+="<footer></footer></div>",document.getElementById(tag).innerHTML=content}"diaspora"==servertype?url=domain+"/public/"+user+".atom":"mastodon"==servertype?url=domain+"/@"+user+".atom":url=domain+"/feed/"+user,window.onload=getAtom; diff --git a/static/js/friendica_comments.js b/static/js/friendica_comments.js new file mode 100644 index 0000000..712e019 --- /dev/null +++ b/static/js/friendica_comments.js @@ -0,0 +1,46 @@ +var article = document.getElementsByTagName("article")[0].innerHTML; +var article_name= article.substring(article.indexOf('<p>')+3,article.indexOf('<p>')+33); +var search = friendica_domain + "/search?search=" + article_name.replace(/ /gi,'+'); +var http, http2 = null; +var ergebnis = ""; + +http = new XMLHttpRequest(); +if (http !== null) { + http.open("GET", search, true); + http.onreadystatechange = SearchFriendica; + http.send(null); +} + +function SearchFriendica() { + if (http.readyState == 4 && http.status==200) { + var SearchResult= http.responseText; + var start = SearchResult.indexOf('wall-item-bottom'); + var start2 = SearchResult.indexOf('a href=\'http',start); + var end = SearchResult.indexOf('id',start); + ergebnis = SearchResult.substring(start2+8,end-2); + } + +http2 = new XMLHttpRequest(); + if (http2 !== null) { + http2.open("GET", ergebnis, true); + http2.onreadystatechange = SearchComments; + http2.send(null); +} + +function SearchComments() { + if (http.readyState == 4 && http.status == 200) { + var CommentsResult = http2.responseText; + var ergebnisse = ("<div class='comment'> <a href='" + ergebnis +"'> Comments</a> powered by Friendica</div>" ); + var arr = new Array(); + arr = CommentsResult.split("wall-item-container comment"); + for (i=1;i<arr.length;i++){ + var photo = arr[i].substring(arr[i].indexOf('<a href'),arr[i].indexOf('</a>')+4); + var start = arr[i].indexOf('<div class=\"wall-item-actions-author\">'); + var end = arr[i].indexOf('<div class=\"wall-item-bottom\">',start); + var comment = arr[i].substring(start,end-1); + ergebnisse = ergebnisse + '<div class=\"comment-container\">' + photo + comment + '</div>'; + } + document.getElementById("comments").innerHTML = ergebnisse; + } +} +} \ No newline at end of file diff --git a/templates/article.html b/templates/article.html new file mode 100644 index 0000000..e84d8d0 --- /dev/null +++ b/templates/article.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} +{% block title %}{{ article.title }} - {{ SITENAME }}{% endblock %} +{% block extra_meta %} +<meta name="description" content="{{ article.summary|striptags }}"> + +{% endblock %} +{% block content %} +<article class="full"> +<h1>{{ article.title }}</h1> +{% include 'metadata.inc.html' %} +{{ article.content }} +</article> +{% if FRIENDICA_COMMENTS %} +<div id="comments"> +</div> +<script type="text/javascript" src=./theme/js/friendica_comments.js></script> +{% endif %} +{% endblock %} \ No newline at end of file diff --git a/templates/article_link.inc.html b/templates/article_link.inc.html new file mode 100644 index 0000000..f8f958f --- /dev/null +++ b/templates/article_link.inc.html @@ -0,0 +1,4 @@ +<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title}}">{{ article.title }}</a> + <time datetime="{{ article.date.isoformat() }}" pubdate>{{ article.locale_date }}</time> + {% if article.tags %}<p class="tags">tags: {% for tag in article.tags %}<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }} </a>{% endfor %}</p>{% endif %} +</a> diff --git a/templates/article_summary.inc.html b/templates/article_summary.inc.html new file mode 100644 index 0000000..12f2a2e --- /dev/null +++ b/templates/article_summary.inc.html @@ -0,0 +1,9 @@ +<article class="summary"> + <div> + <h2> + <a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title}}">{{ article.title }}</a> + </h2> + {% include 'metadata.inc.html' %} + <p>{{ article.summary }}</p> + </div> +</article> diff --git a/templates/author.html b/templates/author.html new file mode 100644 index 0000000..4ba8dfc --- /dev/null +++ b/templates/author.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% block title %}{{ author }} - {{ SITENAME }}{% endblock %} + +{% block content %} + +<h1>Posts published by: {{ author }}</h1> + +{% for article in articles_page.object_list %} + {% include 'article_summary.inc.html' %} +{% endfor %} + +{% include 'pagination.inc.html' %} + +{% endblock %} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..c4f3033 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,168 @@ +<!DOCTYPE html> +<html lang="{{ HTML_LANG }}"> +<head> + <meta charset="utf-8"/> + <title>{% block title %}{{ SITENAME }}{%endblock%} + + + {% block extra_meta %} + {% endblock %} + + + + + {% block scripts %} + {% if FRIENDICA_COMMENTS %} + + {% endif %} + {% endblock %} + + {% if FEED_ALL_ATOM %} + + {% endif %} + {% if FEED_ALL_RSS %} + + {% endif %} + {% if FEDERATION_TIMELINE %} + + {% endif %} + + + +{{ FEED_ATOM }} +
+
+ {% if FEED_ALL_ATOM %} + atom feed + {% endif %} + {% if FEED_ALL_RSS %} + rss feed + {% endif %} +
+ {{ SITENAME }} + {% if pages %} + + {% endif %} + +
+ +
+ {% if CATEGORIES_ON_SIDEBAR =='left' %} + + {% endif %} +
+ {% block content %}{% endblock %} +
+ +
+ + + +
+ + + + diff --git a/templates/category.html b/templates/category.html new file mode 100644 index 0000000..6d096dc --- /dev/null +++ b/templates/category.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% block title %}{{ category }} - {{ SITENAME }}{% endblock %} + +{% block content %} + +

Category: {{ category }}

+ +{% for article in articles_page.object_list %} + {% include 'article_summary.inc.html' %} +{% endfor %} + +{% include 'pagination.inc.html' %} + +{% endblock %} diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..f55b253 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,38 @@ +{% extends "base.html" %} +{% block content_title %}{% endblock %} +{℅ block meta_other %} + +{℅ endblock %} +{% if SITEDESCRIPTION %} +

{{ SITEDESCRIPTION }} +{% endif %} +{% block content %} +{% for article in articles %} + {% if loop.index == 1 %} +

+

{{ article.title }}

+ {{ article.content }} +
+ +
+ + {% if loop.length > 1 %} +
+

Last posts

+
    + {% endif %} + + {% elif loop.index < 7 %} +
  1. + {% include 'article_link.inc.html' %} +
  2. + {% endif %} + +{% endfor %} + +{% if articles|length > 1 %} +
+
+{% endif %} + +{% endblock content %} diff --git a/templates/metadata.inc.html b/templates/metadata.inc.html new file mode 100644 index 0000000..3074669 --- /dev/null +++ b/templates/metadata.inc.html @@ -0,0 +1,15 @@ +{% if not CATEGORIES_ON_SIDEBAR =='left' %} +

+ + {{ article.locale_date }} + + {% if article.author %} + + by {{ article.author }} + + {% endif %} + in {{ article.category }} + {% if article.tags %}

tagged {% for tag in article.tags %}{{ tag }}{% if not loop.last%}, {% endif %}{% endfor %}

{% endif %} + {% if PDF_PROCESSOR %}

Download the .pdf

{% endif %} +

+{% endif %} diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..220266d --- /dev/null +++ b/templates/page.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} +{% block title %}{{ page.title }}- {{ SITENAME }}{% endblock %} + +{% block content %} + +

{{ page.title }}

+{{ page.content }} + +{% endblock %} \ No newline at end of file diff --git a/templates/pagination.inc.html b/templates/pagination.inc.html new file mode 100644 index 0000000..64a80b3 --- /dev/null +++ b/templates/pagination.inc.html @@ -0,0 +1,15 @@ +{% if DEFAULT_PAGINATION %} + +{% endif %} diff --git a/templates/tag.html b/templates/tag.html new file mode 100644 index 0000000..c4181ac --- /dev/null +++ b/templates/tag.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% block title %}{{ tag }} - {{ SITENAME }}{% endblock %} + +{% block content %} + +

Post tagged: {{ tag }}

+ +{% for article in articles_page.object_list %} + {% include 'article_summary.inc.html' %} +{% endfor %} + +{% include 'pagination.inc.html' %} + +{% endblock %} \ No newline at end of file diff --git a/templates/tags.html b/templates/tags.html new file mode 100644 index 0000000..a97828d --- /dev/null +++ b/templates/tags.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% block title %}{{ SITENAME }}{% endblock %} + +{% block content %} + +

Tags

+ + + +{% endblock %}