Merge branch 'master' into portfolio
7 files added
17 files modified
| | |
| | | # Number of days of inactivity before a stale issue is closed |
| | | daysUntilClose: 7 |
| | | # Issues with these labels will never be considered stale |
| | | exemptLabels: |
| | | - pinned |
| | | - security |
| | | onlyLabels: |
| | | - awaiting-reply |
| | | # Label to use when marking an issue as stale |
| | | staleLabel: wontfix |
| | | # Comment to post when marking an issue as stale. Set to `false` to disable |
| New file |
| | |
| | | name: format |
| | | |
| | | on: |
| | | push: |
| | | branches: master |
| | | |
| | | jobs: |
| | | format: |
| | | runs-on: ubuntu-latest |
| | | steps: |
| | | - name: checkout code |
| | | uses: actions/checkout@v2 |
| | | - name: setup node |
| | | uses: actions/setup-node@v2 |
| | | - name: install |
| | | run: npm ci |
| | | - name: format |
| | | run: npm run prettier |
| | | - name: commit changes |
| | | uses: stefanzweifel/git-auto-commit-action@v4 |
| | | with: |
| | | commit_message: 'style: prettier format all files' |
| | |
| | | - Open Graph support |
| | | - MIT License |
| | | - Fontawesome 5.15.1 icons |
| | | - Google Fonts support |
| | | - Custom CSS (optional) |
| | | - Custom JavaScript (optional) |
| | | - Medium like zoom for images |
| | | - Compliant to strict CSP |
| | | - Syntax highlighting |
| | | - Uses Hugo pipes to process assets |
| | | - Series |
| | | |
| | | ## Preview the exampleSite |
| | | |
| | |
| | | listDateFormat = "Jan 2" |
| | | ``` |
| | | |
| | | ### Change the language names in the language dropdown |
| | | |
| | | The language names displayed on the main menu are controlled by the variables `LanguageName`. You can set these to shortcode, full name or a flag emoji by simply changing the parameter. In the following example English will be displayed as "EN" and Arabic will be displayed as "Arabic". |
| | | |
| | | ```toml |
| | | [languages] |
| | | [en] |
| | | LanguageName = "EN" |
| | | |
| | | |
| | | [ar] |
| | | LanguageName = "Arabic" |
| | | ``` |
| | | |
| | | ### Changing the sidebar/content ratio |
| | | |
| | | By default, the content fills up 60% of the screen width on devices with a full HD resolution. If you want to change the ratio, adjust the `contentratio` variable. Let's, for example, set the content ratio to 70%: |
| | |
| | | CommentoURL = "https://commento.example.com/js/commento.js" |
| | | ``` |
| | | |
| | | ### Comments powered by Gitalk |
| | | |
| | | No comment section is shown on the `single.html` unless a `repo` is specified in the `config.toml` file. If uncertain how parameter to configure, check out the official [documentation](https://github.com/gitalk/gitalk). |
| | | |
| | | ```toml |
| | | [params.gitalk] |
| | | clientID = "GitHub Application Client ID" |
| | | clientSecret = "GitHub Application Client Secret" |
| | | repo = "Repository name to store issues" |
| | | owner = "GitHub repo owner" |
| | | admin = "GitHub repo owner and collaborators, only these guys can initialize gitHub issues" |
| | | ``` |
| | | |
| | | ### Disabling Comments Per Page |
| | | |
| | | Comments can be disabled per page by setting `disableComments: true` on the pages [Front Matter](https://gohugo.io/content-management/front-matter/) |
| | |
| | | |
| | | Replace the hash with the one Google provided you. |
| | | |
| | | ### Google Fonts |
| | | |
| | | You can enable any [Google Font](https://fonts.google.com/) by selecting a font on the Google Font website and adding the `family` parameter of the font url to the `googleFonts` option in `[params]`, e.g.: |
| | | |
| | | ```toml |
| | | [params] |
| | | googleFonts = [ |
| | | "Indie+Flower", |
| | | "Roboto:ital,wght@0,100;0,400;0,700;1,400" |
| | | ] |
| | | ``` |
| | | |
| | | ### Beautiful math functions |
| | | |
| | | ```toml |
| | |
| | | |
| | | Additionally, you can include the `{{% loading %}}` shortcode, which will display a spinner on the page that will be redirected. If it does not display, make sure that unsafe mode is enabled for `markup.goldmark.renderer`. |
| | | |
| | | ### Enable Table of Contents |
| | | |
| | | You can enable a table of contents on a per post basis by adding the following parameter into the front matter of the posts you want the table of contents to appear on. |
| | | |
| | | ```md |
| | | +++ |
| | | ... |
| | | toc = true |
| | | +++ |
| | | ``` |
| | | |
| | | Please note that only "## H2 Headings" and "### H3 Headings" will appear in the table of contents. |
| | | |
| | | ### Enabling Series |
| | | |
| | | You can enable series, which allows splitting up a huge post into a set of multiple blog posts that are still linked. This would also provide a unique link to the full series of blog posts. Each individual post in the series will also contain links to the other parts under the heading `Posts in this Series`. |
| | | |
| | | First, we need to enable the `series` taxonomy in the config. |
| | | |
| | | ```toml |
| | | [taxonomies] |
| | | category = "categories" |
| | | series = "series" |
| | | tag = "tags" |
| | | ``` |
| | | |
| | | With this enabled, we can now proceed to specify the series in the Front Matter of each post of that series. |
| | | |
| | | ```md |
| | | series: - series-name |
| | | ``` |
| | | |
| | | If you want to share the full series, you can do so by sharing the link `<base-url>/series/<series-name>` |
| | | |
| | | ## License |
| | | |
| | | Anatole is licensed under the [MIT license](https://github.com/lxndrblz/anatole/blob/master/LICENSE). |
| | |
| | | --chr-kp-color: #00a8c8; |
| | | --chr-kr-color: #00a8c8; |
| | | --chr-kt-color: #00a8c8; |
| | | --chr-n-color: #111111; |
| | | --chr-na-color: #75af00; |
| | | --chr-nb-color: #111111; |
| | | --chr-bp-color: #111111; |
| | | --chr-nc-color: #75af00; |
| | | --chr-no-color: #00a8c8; |
| | |
| | | --chr-nf-color: #75af00; |
| | | --chr-fm-color: #111111; |
| | | --chr-nl-color: #111111; |
| | | --chr-nn-color: #111111; |
| | | --chr-nx-color: #75af00; |
| | | --chr-py-color: #111111; |
| | | --chr-nt-color: #f92672; |
| | | --chr-nv-color: #111111; |
| | | --chr-vc-color: #111111; |
| | | --chr-vg-color: #111111; |
| | | --chr-vi-color: #111111; |
| | |
| | | |
| | | /* Background */ |
| | | .chroma { |
| | | direction: ltr; |
| | | color: var(--chr-def-color); |
| | | background-color: var(--chr-def-bg-color); |
| | | } |
| | |
| | | width: var(--sidebar-width); |
| | | } |
| | | |
| | | /* |
| | | Language Switch |
| | | */ |
| | | |
| | | .sl-nav { |
| | | margin: 0; |
| | | padding: 0; |
| | | list-style: none; |
| | | position: relative; |
| | | display: inline-block; |
| | | padding-right: 20px; |
| | | } |
| | | |
| | | .sl-nav a:hover { |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .sl-nav li { |
| | | cursor: pointer; |
| | | padding-bottom: 10px; |
| | | } |
| | | |
| | | .sl-nav li .dropdown { |
| | | display: none; |
| | | position: absolute; |
| | | top: 29px; |
| | | right: -15px; |
| | | background: var(--pre-bg-color); |
| | | border-color: var(--border-color); |
| | | padding-left: 0; |
| | | padding-top: 0px; |
| | | z-index: 1; |
| | | border-radius: 5px; |
| | | box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2); |
| | | } |
| | | |
| | | #languagepicker:checked ~ .dropdown { |
| | | display: block; |
| | | } |
| | | |
| | | .sl-nav li .dropdown li { |
| | | position: relative; |
| | | text-align: left; |
| | | background: transparent; |
| | | padding: 15px 15px; |
| | | padding-bottom: 0; |
| | | z-index: 2; |
| | | color: #3c3c3c; |
| | | display: block; |
| | | } |
| | | .sl-nav li .dropdown li:last-of-type { |
| | | padding-bottom: 15px; |
| | | } |
| | | .sl-nav li .dropdown li span { |
| | | padding-left: 5px; |
| | | font-size: 1.3rem; |
| | | } |
| | | .sl-nav li .dropdown li span.active { |
| | | color: var(--tag-color); |
| | | } |
| | | |
| | | #languagepicker:checked ~ .triangle { |
| | | position: absolute; |
| | | top: 15px; |
| | | right: -10px; |
| | | z-index: 10; |
| | | height: 14px; |
| | | overflow: hidden; |
| | | width: 30px; |
| | | background: transparent; |
| | | } |
| | | |
| | | #languagepicker:checked ~ .triangle:after { |
| | | content: ''; |
| | | display: block; |
| | | z-index: 20; |
| | | width: 15px; |
| | | transform: rotate(45deg) translateY(0px) translatex(10px); |
| | | height: 15px; |
| | | background: var(--pre-bg-color); |
| | | border-radius: 2px 0px 0px 0px; |
| | | border-color: var(--border-color); |
| | | box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2); |
| | | float: left; |
| | | display: block; |
| | | } |
| | | |
| | | .sidebar { |
| | | -webkit-background-size: cover; |
| | | background-size: cover; |
| | |
| | | margin: 30px; |
| | | padding: 0px 0 56px 0; |
| | | text-align: center; |
| | | font-size: 1.4rem; |
| | | } |
| | | |
| | | .pagination ul { |
| | |
| | | display: none; |
| | | } |
| | | |
| | | @media screen and (min-width: 960px), print { |
| | | #TableOfContents { |
| | | display: block; |
| | | background: transparent; |
| | | } |
| | | |
| | | #TableOfContents ul { |
| | | list-style: none; |
| | | line-height: 1.9em; |
| | | margin: 0; |
| | | } |
| | | |
| | | #TableOfContents > ul { |
| | | padding-left: 0; |
| | | } |
| | | |
| | | #TableOfContents li a { |
| | | display: inherit; |
| | | color: var(--link-color); |
| | | } |
| | | |
| | | #TableOfContents li a:hover { |
| | | display: inherit; |
| | | } |
| | | |
| | | @media screen and (min-width: 961px), print { |
| | | header { |
| | | border-bottom: 1px solid var(--border-color); |
| | | } |
| | |
| | | font-size: 1.3em; |
| | | } |
| | | |
| | | header .nav__list ul { |
| | | padding: inherit; |
| | | } |
| | | |
| | | header .nav__list a.current { |
| | | border-bottom: none; |
| | | } |
| | |
| | | padding-bottom: 0px; |
| | | padding-top: 0px; |
| | | } |
| | | |
| | | .triangle { |
| | | display: none; |
| | | } |
| | | |
| | | .sl-nav { |
| | | padding-right: inherit; |
| | | } |
| | | |
| | | .sl-nav li .dropdown { |
| | | right: inherit; |
| | | position: relative; |
| | | top: inherit; |
| | | padding-right: 0px; |
| | | background: none; |
| | | border-color: inherit; |
| | | box-shadow: none; |
| | | } |
| | | |
| | | .sl-nav li .dropdown li { |
| | | text-align: center; |
| | | padding: initial; |
| | | } |
| | | |
| | | .sl-nav li .dropdown li span { |
| | | padding-left: initial; |
| | | } |
| | | |
| | | .sl-nav li label { |
| | | font-size: 0.75em; |
| | | } |
| | | } |
| | | |
| | | /* Medium zoom */ |
| | |
| | | background-color: var(--bg-color); |
| | | border: 1px solid var(--form-border-color); |
| | | color: var(--body-color); |
| | | font-family: inherit; |
| | | } |
| | | .form-style ul li .field-style:focus { |
| | | box-shadow: 0 0 5px; |
| | |
| | | @charset "UTF-8"; |
| | | |
| | | body { |
| | | font-family: 'Tajawal', sans-serif; |
| | | font-size: 1.5rem; |
| | | } |
| | | |
| | | blockquote { |
| | | border-right: 0.25em solid var(--blockquote-border-color); |
| | | border-left: inherit; |
| | |
| | | margin-right: inherit; |
| | | } |
| | | |
| | | .sidebar .logo-title .title h3 { |
| | | text-transform: capitalize; |
| | | letter-spacing: 1.5px; |
| | | } |
| | | |
| | | .post .post-title h1 { |
| | | text-transform: capitalize; |
| | | } |
| | | |
| | | .post .post-title h3 { |
| | | text-transform: capitalize; |
| | | } |
| | | |
| | | .post .post-footer .info .separator a { |
| | | margin-left: 0.2em; |
| | | margin-right: inherit; |
| | |
| | | text-align: left; |
| | | } |
| | | |
| | | @media screen and (min-width: 960px), print { |
| | | .sl-nav li .dropdown { |
| | | padding-right: 0px; |
| | | } |
| | | |
| | | .triangle { |
| | | display: none; |
| | | } |
| | | |
| | | @media screen and (min-width: 961px), print { |
| | | header { |
| | | position: fixed; |
| | | left: 0; |
| | |
| | | header .nav__list li:not(:last-of-type) { |
| | | padding-right: inherit; |
| | | } |
| | | .triangle { |
| | | display: inline-block; |
| | | } |
| | | } |
| | | |
| | | @media (min-width: 1921px) { |
| | |
| | | [markup] |
| | | [markup.goldmark] |
| | | [markup.goldmark.renderer] |
| | | unsafe=true |
| | | unsafe=true |
| | | |
| | | [taxonomies] |
| | | category = "categories" |
| | | series = "series" |
| | | tag = "tags" |
| | |
| | | contentDir = "content/english" |
| | | |
| | | [ar] |
| | | title = "عربي" |
| | | description = "أنا أحمد" |
| | | title = "فلانة الفلانية" |
| | | description = "أنا أعمل كمطورة ويب في شركة س" |
| | | contentDir = "content/arabic" |
| | | weight = 2 |
| | | LanguageDirection = "rtl" |
| | |
| | | name = "الرئيسية" |
| | | identifier = "main" |
| | | weight = 100 |
| | | url = "/ar" |
| | | url = "/ar/" |
| | | |
| | | [[main]] |
| | | name = "المنشورات" |
| | | weight = 200 |
| | | identifier = "posts" |
| | | url = "/ar/post" |
| | | url = "/ar/post/" |
| | | |
| | | [[main]] |
| | | name = "حول" |
| | | weight = 300 |
| | | identifier = "about" |
| | | url = "/ar/about" |
| | | url = "/ar/about/" |
| | | |
| | | [[main]] |
| | | name = "للتواصل" |
| | | weight = 400 |
| | | identifier = "contact" |
| | | url = "/ar/contact" |
| | | url = "/ar/contact/" |
| | |
| | | doNotLoadAnimations = false |
| | | # Form Spree Contact Form |
| | | #contactFormAction = "https://formspree.io/f/your-form-hash-here" |
| | | # Google Fonts |
| | | #googleFonts = ["Indie+Flower", "Roboto:ital,wght@0,100;0,400;0,700;1,400"] |
| | | # Google Site Verify |
| | | #googleSiteVerify = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" |
| | | singleDateFormat = "2/1/2006" |
| | |
| | | إذا كنت تحتاج إلى عدد أكبر من الفقرات يتيح لك مولد النص العربى زيادة عدد الفقرات كما تريد، النص لن يبدو مقسما ولا يحوي أخطاء لغوية، مولد النص العربى مفيد لمصممي المواقع على وجه الخصوص، حيث يحتاج العميل فى كثير من الأحيان أن يطلع على صورة حقيقية لتصميم الموقع. |
| | | ومن هنا وجب على المصمم أن يضع نصوصا مؤقتة على التصميم ليظهر للعميل الشكل كاملاً،دور مولد النص العربى أن يوفر على المصمم عناء البحث عن نص بديل لا علاقة له بالموضوع الذى يتحدث عنه التصميم فيظهر بشكل لا يليق. |
| | | هذا النص يمكن أن يتم تركيبه على أي تصميم دون مشكلة فلن يبدو وكأنه نص منسوخ، غير منظم، غير منسق، أو حتى غير مفهوم. لأنه مازال نصاً بديلاً ومؤقتاً. |
| | | |
| | | ```html |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <body> |
| | | <h1>My First Heading</h1> |
| | | <p>My first paragraph.</p> |
| | | </body> |
| | | </html> |
| | | ``` |
| New file |
| | |
| | | --- |
| | | author: Hugo Authors |
| | | title: Series Part 1 |
| | | date: 2021-08-14 |
| | | description: A brief guide to how to setup series part 1 |
| | | series: |
| | | - series-setup |
| | | --- |
| | | |
| | | In this first part of the series we'll show you how to create a series |
| | | |
| | | <!--more--> |
| | | |
| | | As a first step we need to add series as a taxonomy. We can do this by editing the `config.toml`. |
| | | Note: We always need to define the existing taxonomies as well. |
| | | |
| | | ```toml |
| | | [taxonomies] |
| | | category = "categories" |
| | | series = "series" |
| | | tag = "tags" |
| | | ``` |
| | | |
| | | Now we have the series enabled, the next thing we need to do is add the series name in the FrontMatter. |
| | | For our example we'll use this post and the next part. |
| | | |
| | | As you can see we've set the series to `series-setup`. We also do the same in the next parts of the series. |
| | | This end results should be a Front Matter that looks similar to this: |
| | | |
| | | ```md |
| | | --- |
| | | author: Hugo Authors |
| | | title: Series Part 1 |
| | | date: 2021-08-14 |
| | | description: A brief guide to how to setup series part 1 |
| | | series: |
| | | - series-setup |
| | | --- |
| | | ``` |
| | | |
| | | Each individual post will now also show the other posts in the series under the `Posts in this Series` heading. |
| New file |
| | |
| | | --- |
| | | author: Hugo Authors |
| | | title: Series Part 2 |
| | | date: 2021-08-15 |
| | | description: A brief guide to how to setup series part 2 |
| | | series: |
| | | - series-setup |
| | | --- |
| | | |
| | | In this second part of the series we'll show you where to find the full series |
| | | |
| | | <!--more--> |
| | | |
| | | When you created a series, you'll probably want to link to the full set of blogposts. |
| | | In this example we used `series-setup` as our series name. |
| | | |
| | | This means we can now go to `http://localhost:1313/series/series-setup/` to see all the blog posts of this serie. |
| | |
| | | {{ end }} |
| | | </div> |
| | | |
| | | {{- if (eq .Params.toc true) -}} |
| | | <h3>Table of Contents</h3> |
| | | {{ .TableOfContents }} |
| | | |
| | | |
| | | {{- end -}} |
| | | |
| | | {{ .Content }} |
| | | |
| | | {{- if isset .Params "series" -}} |
| | | {{- partial "series.html" . -}} |
| | | |
| | | |
| | | {{- end -}} |
| | | |
| | | {{- if (eq .Params.contact true) -}} |
| | | {{- partial "contact.html" . -}} |
| | | |
| | |
| | | </div> |
| | | |
| | | {{- end -}} |
| | | {{- if .Site.Params.gitalk.repo -}} |
| | | <div id="fb_comments_container"> |
| | | <h2>{{ i18n "comments" }}</h2> |
| | | {{ partial "comments/gitalk.html" . }} |
| | | </div> |
| | | |
| | | {{- end -}} |
| | | |
| | | |
| | | {{ end }} |
| | |
| | | |
| | | {{ end }} |
| | | <div class="pagination"> |
| | | {{ template "_internal/pagination.html" . }} |
| | | {{ template "partials/pagination.html" . }} |
| | | </div> |
| | | |
| | | {{ end }} |
| New file |
| | |
| | | <div id="gitalk-container"></div> |
| | | <link |
| | | rel="stylesheet" |
| | | href="https://cdnjs.cloudflare.com/ajax/libs/gitalk/1.7.2/gitalk.min.css" |
| | | integrity="sha512-0hsIlRjJbiUWaKMhXXNDmjWI2qPvUlhNBLHMhqeF5jIma+bedec27N5FoT2JEeHz5TUmOGCsm1Y89EsX/P0wOg==" |
| | | crossorigin="anonymous" |
| | | referrerpolicy="no-referrer" |
| | | /> |
| | | <script |
| | | src="https://cdnjs.cloudflare.com/ajax/libs/gitalk/1.7.2/gitalk.min.js" |
| | | integrity="sha512-EcTCcXV46teiNwe0VcnM5A038tcY+BaQYO4nW6Gh2i7v4/HjBVg7xx3+JBLl9WofDds//INJAiEGAtdgr8PWyA==" |
| | | crossorigin="anonymous" |
| | | referrerpolicy="no-referrer" |
| | | ></script> |
| | | <script> |
| | | const gitalk = new Gitalk({ |
| | | clientID: '{{ .Site.Params.Gitalk.clientID }}', |
| | | clientSecret: '{{ .Site.Params.Gitalk.clientSecret }}', |
| | | repo: '{{ .Site.Params.Gitalk.repo }}', |
| | | owner: '{{ .Site.Params.Gitalk.owner }}', |
| | | admin: ['{{ .Site.Params.Gitalk.admin }}'], |
| | | id: location.pathname, // Ensure uniqueness and length less than 50 |
| | | distractionFreeMode: false, // Facebook-like distraction free mode |
| | | }); |
| | | (function () { |
| | | if (['localhost', '127.0.0.1'].indexOf(window.location.hostname) != -1) { |
| | | document.getElementById('gitalk-container').innerHTML = |
| | | 'Gitalk comments not available by default when the website is previewed locally.'; |
| | | return; |
| | | } |
| | | gitalk.render('gitalk-container'); |
| | | })(); |
| | | </script> |
| | |
| | | <textarea class="field-style" name="message" id="message" rows="6" placeholder="{{ i18n "message" }}"></textarea> |
| | | </li> |
| | | <li> |
| | | <input class="field-style" type="submit" value="{{ i18n "send" }}"></input> |
| | | <input class="field-style" type="submit" value="{{ i18n "send" }}" /> |
| | | </li> |
| | | <li> |
| | | <input type="text" name="_gotcha" style="display:none" /> |
| | | </li> |
| | | </ul> |
| | | </form> |
| | |
| | | {{- partial "medium-zoom.html" .context -}} |
| | | {{- partial "math.html" .context -}} |
| | | {{- template "_internal/google_analytics_async.html" .context -}} |
| | | {{- if and (hugo.IsProduction) (.Site.Params.gtagId) -}} |
| | | {{- if and (hugo.IsProduction) (.context.Site.Params.gtagId) -}} |
| | | {{ partial "google-analytics-gtag-async.html" .context }} |
| | | |
| | | |
| | |
| | | type="text/css" |
| | | /> |
| | | {{ if eq .Site.Language.LanguageDirection "rtl" }} |
| | | <!-- Arabic font --> |
| | | <link |
| | | rel="stylesheet" |
| | | href="https://fonts.googleapis.com/css?family=Tajawal:300,500,700&display=swap&subset=arabic" |
| | | /> |
| | | {{ $templateStyle := resources.Get "css/style.rtl.css" }} |
| | | {{ $style := $templateStyle | resources.ExecuteAsTemplate "css/main.rtl.css" . | resources.Minify | resources.Fingerprint }} |
| | | <link |
| | |
| | | /> |
| | | |
| | | {{- end -}} |
| | | {{ if .Site.Params.googleFonts }} |
| | | {{ $baseUrl := "https://fonts.googleapis.com/css2?family=" }} |
| | | {{ $fontParam := delimit .Site.Params.googleFonts "&family=" }} |
| | | {{ $url := printf "%s" "&display=swap" | printf "%s%s" $fontParam | printf "%s%s" $baseUrl | printf "%s" }} |
| | | <link rel="preconnect" href="https://fonts.googleapis.com" /> |
| | | <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> |
| | | <link href="{{ $url }}" rel="stylesheet" /> |
| | | |
| | | {{- end -}} |
| | | |
| | | |
| | | <!-- Favicons --> |
| | | <link rel="shortcut icon" href="{{ .Site.Params.favicon | relURL }}favicon.ico" type="image/x-icon" /> |
| | | <link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.favicon | relURL }}apple-touch-icon.png" /> |
| | |
| | | |
| | | |
| | | {{- end }} |
| | | |
| | | |
| | | <!-- Schema.org--> |
| | | {{ partial "schema.html" . }} |
| | | </head> |
| | |
| | | </li> |
| | | |
| | | {{ end }} |
| | | {{ if .Site.IsMultiLingual }} |
| | | {{ range $.Site.Home.AllTranslations }} |
| | | <li><a href="{{ .RelPermalink }}" title="{{ .Language.LanguageName }}">{{ .Language.LanguageName }}</a></li> |
| | | |
| | | {{ end }} |
| | | |
| | | |
| | | {{ end }} |
| | | </div> |
| | | <li> |
| | | {{ if not .Site.Params.disableThemeSwitcher }} |
| | | <a class="theme-switch" title="Switch Theme"> |
| | | <i class="fas fa-adjust fa-fw" aria-hidden="true"></i> |
| | | </a> |
| | | <ul> |
| | | {{ if and .IsTranslated .Site.IsMultiLingual }} |
| | | <li> |
| | | <ul class="sl-nav" aria-label="Language switcher"> |
| | | <li> |
| | | <input type="checkbox" id="languagepicker" aria-label="switch language" hidden /> |
| | | <label for="languagepicker"><a>{{ .Site.Language.LanguageName }}</a></label> |
| | | <label for="languagepicker"><i class="fa fa-angle-down" aria-hidden="true"></i></label> |
| | | <div class="triangle"></div> |
| | | |
| | | <ul class="dropdown"> |
| | | {{ range $.Translations }} |
| | | |
| | | <li> |
| | | <a href="{{ .RelPermalink }}" title="{{ .Language.LanguageName }}" |
| | | ><span |
| | | {{ if eq . $.Site.Language }} |
| | | class="active" |
| | | |
| | | {{ end }} |
| | | aria-label="{{ i18n "ariaLanguage" }}{{ .Language.LanguageName }}" |
| | | >{{ .Language.LanguageName }}</span |
| | | ></a |
| | | > |
| | | </li> |
| | | |
| | | {{ end }} |
| | | </ul> |
| | | </li> |
| | | </ul> |
| | | </li> |
| | | |
| | | {{ end }} |
| | | </li> |
| | | {{ if not .Site.Params.disableThemeSwitcher }} |
| | | <li> |
| | | <a class="theme-switch" title="Switch Theme"> |
| | | <i class="fas fa-adjust fa-fw" aria-hidden="true"></i> |
| | | </a> |
| | | </li> |
| | | |
| | | {{ end }} |
| | | </ul> |
| | | </ul> |
| | | </nav> |
| | | </div> |
| New file |
| | |
| | | {{ if gt .Paginator.TotalPages 1 }} |
| | | <ul class="pagination"> |
| | | {{ $.Scratch.Set "hasPrevDots" false }} |
| | | {{ $.Scratch.Set "hasNextDots" false }} |
| | | {{ if .Paginator.HasPrev }} |
| | | <li class="page-item"> |
| | | <a class="page-link" href="{{ .Paginator.Prev.URL }}"> |
| | | <i class="fa fa-angle-left" aria-label="上一页"></i> |
| | | </a> |
| | | </li> |
| | | |
| | | {{ end }} |
| | | {{ range .Paginator.Pagers }} |
| | | {{ if eq . $.Paginator }} |
| | | <li class="page-item"> |
| | | <span class="page-link current"> |
| | | {{- .PageNumber -}} |
| | | </span> |
| | | </li> |
| | | |
| | | {{ else if or (or (eq . $.Paginator.First) (eq . $.Paginator.Prev)) (or (eq . $.Paginator.Next) (eq . $.Paginator.Last )) }} |
| | | <li class="page-item"> |
| | | <a class="page-link" href="{{ .URL }}"> |
| | | {{- .PageNumber -}} |
| | | </a> |
| | | </li> |
| | | |
| | | {{ else }} |
| | | {{ if and (not ($.Scratch.Get "hasPrevDots")) (lt .PageNumber $.Paginator.PageNumber) }} |
| | | {{ $.Scratch.Set "hasPrevDots" true }} |
| | | <span class="page-link dots">…</span> |
| | | |
| | | {{ else if and (not ($.Scratch.Get "hasNextDots")) (gt .PageNumber $.Paginator.PageNumber) }} |
| | | {{ $.Scratch.Set "hasNextDots" true }} |
| | | <span class="page-link dots">…</span> |
| | | |
| | | {{ end }} |
| | | |
| | | |
| | | {{ end }} |
| | | |
| | | |
| | | {{ end }} |
| | | {{ if .Paginator.HasNext }} |
| | | <li class="page-item"> |
| | | <a class="page-link" href="{{ .Paginator.Next.URL }}"> |
| | | <i class="fa fa-angle-right" aria-label="下一页"></i> |
| | | </a> |
| | | </li> |
| | | |
| | | {{ end }} |
| | | </ul> |
| | | |
| | | {{ end }} |
| New file |
| | |
| | | {{ if .IsHome -}} |
| | | <script type="application/ld+json"> |
| | | { |
| | | "@context": "http://schema.org", |
| | | "@type": "WebSite", |
| | | "name": "{{ .Site.Title }}", |
| | | "url": "{{ .Site.BaseURL }}", |
| | | "description": "{{ .Site.Params.description }}", |
| | | "thumbnailUrl": "{{ .Site.Params.Logo | absURL }}", |
| | | "license": "{{ .Site.Params.Copyright }}" |
| | | } |
| | | </script> |
| | | |
| | | {{ else if .IsPage }} |
| | | {{ $author := or (.Params.author) (.Site.Params.author) }} |
| | | {{ $favicon := .Site.Params.favicon | absURL }} |
| | | <script type="application/ld+json"> |
| | | { |
| | | "@context": "http://schema.org", |
| | | "@type": "BlogPosting", |
| | | "articleSection": "{{ .Section }}", |
| | | "name": "{{ .Title | safeJS }}", |
| | | "headline": "{{ .Title | safeJS }}", |
| | | "alternativeHeadline": "{{ .Params.lead }}", |
| | | "description": "{{ if .Description }} |
| | | {{ .Description | safeJS }} |
| | | |
| | | |
| | | {{ else }} |
| | | {{ if .IsPage }} |
| | | {{ .Summary }} |
| | | |
| | | |
| | | {{ end }} |
| | | |
| | | |
| | | {{ end }}", |
| | | "inLanguage": {{ .Site.LanguageCode | default "en-us" }}, |
| | | "isFamilyFriendly": "true", |
| | | "mainEntityOfPage": { |
| | | "@type": "WebPage", |
| | | "@id": "{{ .Permalink }}" |
| | | }, |
| | | "author" : { |
| | | "@type": "Person", |
| | | "name": "{{ $author }}" |
| | | }, |
| | | "creator" : { |
| | | "@type": "Person", |
| | | "name": "{{ $author }}" |
| | | }, |
| | | "accountablePerson" : { |
| | | "@type": "Person", |
| | | "name": "{{ $author }}" |
| | | }, |
| | | "copyrightHolder" : { |
| | | "@type": "Person", |
| | | "name": "{{ $author }}" |
| | | }, |
| | | "copyrightYear" : "{{ .Date.Format "2006" }}", |
| | | "dateCreated": "{{ .Date.Format "2006-01-02T15:04:05.00Z" | safeHTML }}", |
| | | "datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05.00Z" | safeHTML }}", |
| | | "dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05.00Z" | safeHTML }}", |
| | | "publisher":{ |
| | | "@type":"Organization", |
| | | "name": {{ $author }}, |
| | | "url": {{ .Site.BaseURL }}, |
| | | "logo": { |
| | | "@type": "ImageObject", |
| | | "url": "{{ (printf "%s%s" $favicon "favicon-32x32.png") }}", |
| | | "width":"32", |
| | | "height":"32" |
| | | } |
| | | }, |
| | | "image": {{ if .Params.images }} |
| | | [{{ range $i, $e := .Params.images }} |
| | | {{ if $i }} |
| | | , |
| | | |
| | | {{ end }} |
| | | {{ $e | absURL }} |
| | | |
| | | |
| | | {{ end }} |
| | | ] |
| | | |
| | | {{ else }} |
| | | [{{ range $i, $e := .Site.Params.images }} |
| | | {{ if $i }} |
| | | , |
| | | |
| | | {{ end }} |
| | | {{ $e | absURL }} |
| | | |
| | | |
| | | {{ end }} |
| | | ] |
| | | |
| | | {{ end }}, |
| | | "url" : "{{ .Permalink }}", |
| | | "wordCount" : "{{ .WordCount }}", |
| | | "genre" : [ {{ range $index, $tag := .Params.categories }} |
| | | {{ if $index }} |
| | | , |
| | | |
| | | {{ end }} |
| | | "{{ $tag }}" |
| | | |
| | | {{ end }}], |
| | | "keywords" : [ {{ range $index, $keyword := .Params.tags }} |
| | | {{ if $index }} |
| | | , |
| | | |
| | | {{ end }} |
| | | "{{ $keyword }}" |
| | | |
| | | {{ end }}] |
| | | } |
| | | </script> |
| | | |
| | | {{ end }} |
| New file |
| | |
| | | {{ $related := where .Site.RegularPages ".Params.series" "intersect" .Params.series }} |
| | | |
| | | |
| | | <h3>Posts in this Series</h3> |
| | | <ul> |
| | | {{ range $related }} |
| | | <li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a></li> |
| | | |
| | | {{ end }} |
| | | </ul> |
| | |
| | | <div class="logo-title"> |
| | | <div class="title"> |
| | | <img src="{{ .Site.Params.profilePicture | relURL }}" alt="profile picture" /> |
| | | <h3 title=""><a href="/">{{ .Site.Params.Title }}</a></h3> |
| | | <h3 title=""><a href="{{ .Site.BaseURL | relURL }}">{{ .Site.Params.Title }}</a></h3> |
| | | <div class="description"> |
| | | <p>{{ replace .Site.Params.description "\n" "<br />" | safeHTML }}</p> |
| | | </div> |