mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2025-05-10 14:36:01 +02:00
Compare commits
103 Commits
Author | SHA1 | Date | |
---|---|---|---|
85abd20ba7
|
|||
9e0b00038a
|
|||
9676a9736b
|
|||
4a88be4434
|
|||
780444bfb0
|
|||
58d01baba6
|
|||
9fb0baa0a5
|
|||
550b5c066d
|
|||
3be21cba1d
|
|||
ce3e6a933f
|
|||
22001d38ea
|
|||
d4ece493ba
|
|||
3ab60bddea
|
|||
06113fcd44
|
|||
769c25e2c2
|
|||
4c5ce590f2
|
|||
9b35f3b1dc
|
|||
ba6358ca48
|
|||
77e240280a
|
|||
32af219491
|
|||
1fdd332862
|
|||
a5c50f69c2
|
|||
d2ea109b47
|
|||
5c3ffa7868 | |||
3047cfe356
|
|||
44861dfc36
|
|||
553af337c1
|
|||
63241061dd
|
|||
13449f1519
|
|||
341bff9891
|
|||
c41364cf19
|
|||
44e8c677a6
|
|||
6e36b66fab
|
|||
90a04b31d4 | |||
70c475f490 | |||
1eb8d9009a
|
|||
293c7dff8c
|
|||
6117301edd
|
|||
f2dab16881
|
|||
b2ea655810
|
|||
df1ec1df21
|
|||
80e17a5ffd
|
|||
14417a8153
|
|||
cdf886b4e8
|
|||
7fa92fb2f3
|
|||
be563c6a9f
|
|||
41c88a200f
|
|||
bcc164bc4a | |||
9d6d5f21c0 | |||
b7059a88dc
|
|||
92cab738dd | |||
1aedf82cf8
|
|||
7b649e8717
|
|||
9bf1c85346
|
|||
63e36db2d5 | |||
c1b3e978b7 | |||
4ab2e0da8c
|
|||
23203082f6 | |||
b4c3e06143 | |||
8da12539f3 | |||
c17a7d229f
|
|||
26e0a9a259
|
|||
1faeef487b
|
|||
8d6b318a63
|
|||
cca6636809
|
|||
d6a099a5cd
|
|||
70e79a60fa
|
|||
ed69bec464
|
|||
aed40fe2d3
|
|||
81c64c55dd
|
|||
480f31074d
|
|||
947ec526cd
|
|||
633321fb66
|
|||
78eb7cf237
|
|||
620cfa2366
|
|||
b862745a0d
|
|||
9da05e7869
|
|||
1320168ebd
|
|||
9bb2ec06b0
|
|||
9934368215
|
|||
2db85d8ab6
|
|||
e4876d98cf
|
|||
6a3bdc53fd
|
|||
974203f6eb
|
|||
90d1a79e01
|
|||
ed144e2467
|
|||
f71886b04f
|
|||
4c15fdb00a
|
|||
8ea73321a1
|
|||
37187d06f3
|
|||
fdefc2e541
|
|||
3c81a6ca75
|
|||
dedf1bd62c
|
|||
ad29f240a2
|
|||
b70b3684b6
|
|||
2916229d28
|
|||
3cced68d64
|
|||
1ff41d275d
|
|||
f410c43eed | |||
08cf066111 | |||
fbb4b9f227
|
|||
9613fcdeee
|
|||
13b9552119
|
15
.build.yml
Normal file
15
.build.yml
Normal file
@ -0,0 +1,15 @@
|
||||
image: archlinux
|
||||
packages:
|
||||
- nodejs-lts-erbium
|
||||
- npm
|
||||
sources:
|
||||
- https://git.sr.ht/~alanorth/hugo-theme-bootstrap4-blog
|
||||
tasks:
|
||||
- setup: |
|
||||
id
|
||||
node -v
|
||||
cd hugo-theme-bootstrap4-blog
|
||||
npm install
|
||||
- test: |
|
||||
cd hugo-theme-bootstrap4-blog
|
||||
npm run build
|
@ -1,10 +1,10 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 6
|
||||
- 8
|
||||
- 9
|
||||
- 10
|
||||
- 11
|
||||
script: npm run build
|
||||
sudo: false
|
||||
dist: trusty
|
||||
dist: xenial
|
||||
|
||||
# vim: ts=2 sw=2 et
|
||||
|
76
CHANGELOG.md
Normal file
76
CHANGELOG.md
Normal file
@ -0,0 +1,76 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [[1.4.1]] - 2020-03-19
|
||||
### Updated
|
||||
- npm dependencies: rtlcss 2.5.0, webpack 4.42.0, fontawesome solid icons 5.12.1
|
||||
|
||||
### Fixed
|
||||
- Fix "Unparsable structured data" error in JSON-LD (@alanorth)
|
||||
|
||||
## [[1.4.0]] - 2020-01-28
|
||||
### Added
|
||||
- Farsi strings for user interface
|
||||
|
||||
### Updated
|
||||
- bootstrap 4.4.1
|
||||
- Fix typo in README.md (@xekon, #118)
|
||||
- Font Awesome 5 (make sure you [update](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4) any custom icons you might be using in your content, site layouts, partials, etc).
|
||||
|
||||
### Changed
|
||||
- Use Hugo's built-in subresource integrity support instead of the generatesri
|
||||
tooling that I wrote by hand a few years ago (#120, @alanorth)
|
||||
- Use Font Awesome SVGs via JavaScript instead of web fonts (@alanorth)
|
||||
- Category and tag links now have a trailing slash (#128, @alanorth)
|
||||
|
||||
### Removed
|
||||
- Several references to Google Plus (@xekon, #122)
|
||||
|
||||
## [[1.3.3]] - 2019-12-02
|
||||
### Fixed
|
||||
- "Home" link for blogs that are not at the root of the domain (@phofman #115)
|
||||
|
||||
### Changed
|
||||
- Use "posts" instead of "post" in exampleSite to align closer with Hugo quick start docs (@sboots #117)
|
||||
|
||||
### Updated
|
||||
- node-sass 4.13.0 and rtlcss 2.4.1
|
||||
|
||||
## [[1.3.2]] - 2019-06-20
|
||||
### Changed
|
||||
- Only list "Regular" pages in recent posts in sidebar (@alanorth)
|
||||
- Use absURL instead of baseURL to be more robust with different site configurations (@TommySprat)
|
||||
- Quote date in post metadata so it does not get escaped (@TommySprat #111)
|
||||
|
||||
## [1.3.1] - 2019-05-05
|
||||
### Added
|
||||
- SourceHut CI configuration (@alanorth)
|
||||
|
||||
### Updated
|
||||
- Twitter sharing button (@alanorth)
|
||||
- Dependencies in package.json (@alanorth)
|
||||
|
||||
## [1.3.0] - 2019-04-22
|
||||
### Added
|
||||
- Arabic translation (@alanorth)
|
||||
- Support for RTL CSS (@alanorth)
|
||||
|
||||
### Updated
|
||||
- clean-css-cli 4.3.0
|
||||
|
||||
## [1.2.1] - 2019-04-14
|
||||
### Added
|
||||
- Dutch translation #107 (@bit33)
|
||||
|
||||
### Removed
|
||||
- Google+ icons #108 (@bit33)
|
||||
|
||||
### Updated
|
||||
- Template functions for Hugo 0.55.0 (@alanorth)
|
||||
|
||||
## [1.2.0] - 2019-02-13
|
||||
### Updated
|
||||
- Bootstrap v4.3.1
|
10
README.md
10
README.md
@ -1,4 +1,4 @@
|
||||
# Hugo Bootstrap v4 Blog [](https://travis-ci.org/alanorth/hugo-theme-bootstrap4-blog)
|
||||
# Hugo Bootstrap v4 Blog [](https://travis-ci.org/alanorth/hugo-theme-bootstrap4-blog) [](https://builds.sr.ht/~alanorth/hugo-theme-bootstrap4-blog?)
|
||||
A simple but opinionated [Hugo](https://gohugo.io) theme geared towards blog-style content. Based on the older two-column [Bootstrap blog example](https://v4-alpha.getbootstrap.com/examples/blog/) that was used for several Bootstrap versions, but has now been retired in favor of a "snarky" (their words) new example as of version [4.0.0's final release](https://blog.getbootstrap.com/2018/01/18/bootstrap-4/).
|
||||
|
||||

|
||||
@ -11,14 +11,14 @@ See [picturingjordan.com](https://picturingjordan.com) for an example of this th
|
||||
- Uses Bootstrap v4's [native system font stack](https://getbootstrap.com/docs/4.0/content/reboot/#native-font-stack) to load quickly and look good on all platforms
|
||||
- Excellent [structured data](https://developers.google.com/search/docs/guides/intro-structured-data) (JSON-LD), [OpenGraph](http://ogp.me), and [Twitter Card](https://dev.twitter.com/cards/types) metadata support
|
||||
- robots.txt linking to XML sitemap (disabled by default, see [Hugo docs](https://gohugo.io/extras/robots-txt/))
|
||||
- Basic support for [multi-lingual content](https://gohugo.io/content-management/multilingual/) (added in Hugo 0.17) and user interface translation (i18n)
|
||||
- Basic support for [multi-lingual content](https://gohugo.io/content-management/multilingual/) (added in Hugo 0.17) and user interface translation (i18n), including RTL languages like Arabic and Farsi
|
||||
- Supports Google, Bing, and Yandex site verification via meta tags
|
||||
- Supports Google Analytics (async version), see [Hugo docs](https://gohugo.io/extras/analytics/)
|
||||
- Supports Disqus comments, see [Hugo docs](https://gohugo.io/extras/comments/)
|
||||
- Can show a message about cookie usage to the user, see [`exampleSite/config.toml`](https://github.com/alanorth/hugo-theme-bootstrap4-blog/blob/master/exampleSite/config.toml)
|
||||
- Allow addition of custom `<head>` code in site's `layouts/partial/head-custom.html` (see [#17](https://github.com/alanorth/hugo-theme-bootstrap4-blog/pull/17))
|
||||
- Allow addition of custom `<head>` code in site's `layouts/partials/head-custom.html` (see [#17](https://github.com/alanorth/hugo-theme-bootstrap4-blog/pull/17))
|
||||
- Configurable display of summaries of content in list templates.
|
||||
- configurable keywords for every post
|
||||
- Configurable keywords for every post
|
||||
|
||||
## Usage
|
||||
Clone the repository to your site's `themes` directory. Refer to [`exampleSite/config.toml`](https://github.com/alanorth/hugo-theme-bootstrap4-blog/blob/master/exampleSite/config.toml) for recommended configuration values.
|
||||
@ -38,7 +38,7 @@ A few suggestions to help you get a good looking site quickly:
|
||||
See the source code and structure of [picturingjordan.com](https://github.com/alanorth/picturingjordan.com) to get more ideas.
|
||||
|
||||
## Building (For Developers)
|
||||
This theme uses the [Bootstrap](https://getbootstrap.com/) framework. A static version of this is already included, but if you want to bump the version, tweak the style, etc, you'll need to rebuild the assets. Make sure you have NodeJS >= v6 installed, and then run the following from inside the theme's directory:
|
||||
This theme uses the [Bootstrap](https://getbootstrap.com/) framework. A static version of this is already included, but if you want to bump the version, tweak the style, etc, you'll need to rebuild the assets. Make sure you have NodeJS >= v10 installed, and then run the following from inside the theme's directory:
|
||||
|
||||
```console
|
||||
$ npm install
|
||||
|
6
assets/css/style.css
Normal file
6
assets/css/style.css
Normal file
File diff suppressed because one or more lines are too long
6
assets/css/style.rtl.css
Normal file
6
assets/css/style.rtl.css
Normal file
File diff suppressed because one or more lines are too long
1
assets/js/fontawesome.min.js
vendored
Normal file
1
assets/js/fontawesome.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,5 +0,0 @@
|
||||
{
|
||||
"style": "static/css/style.css",
|
||||
"cookieconsentcss": "static/css/cookieconsent.min.css",
|
||||
"cookieconsentjs": "static/js/cookieconsent.min.js"
|
||||
}
|
23
build/sri.js
23
build/sri.js
@ -1,23 +0,0 @@
|
||||
// Adapted from: https://gist.github.com/jmervine/ae1bace0fe37dce75b90ec3e9592771c
|
||||
|
||||
var crypto = require('crypto');
|
||||
var fs = require('fs');
|
||||
var assets = require('./assets.json');
|
||||
|
||||
var generate384 = function (file) {
|
||||
var enc = 'utf8';
|
||||
var body = fs.readFileSync(file, { encoding: enc });
|
||||
var hash = crypto.createHash('sha384').update(body, enc);
|
||||
var sha = hash.digest('base64');
|
||||
|
||||
return 'sha384-' + sha;
|
||||
}
|
||||
|
||||
for (var asset in assets) {
|
||||
var path = assets[asset];
|
||||
var hash = generate384(path);
|
||||
|
||||
console.log(asset + ' = "' + hash + '"');
|
||||
}
|
||||
|
||||
// vim: set ts=2 sw=2 et:
|
@ -1,3 +0,0 @@
|
||||
style = "sha384-G5B34w7DFTumWTswxYzTX7NWfbvQEg1HbFFEg6ItN03uTAAoS2qkPS/fu3LhuuSA"
|
||||
cookieconsentcss = "sha384-6iYDyQZuuNT7DcPJGXx241czdv2+GDGUcXRiqw1iXrjgYMTorSetxFP3JCMQMwnR"
|
||||
cookieconsentjs = "sha384-PDjg2ZdS3khPzd53i18+7tzB32JVQfFMrTXYo21RqPgUmEVAPwIhxOUF/8sP79CS"
|
@ -6,13 +6,15 @@ title = "Hugo Bootstrap v4 Blog"
|
||||
theme = "hugo-theme-bootstrap4-blog"
|
||||
# number of posts to show on home/category/tag pages (Default: 10)
|
||||
paginate = 5
|
||||
# number of words to use for summary on home/category/tag pages (Default: 70)
|
||||
summaryLength = 50
|
||||
# optionally override the site's footer with custom copyright text
|
||||
# copyright = "Except where otherwise noted, content on this site is licensed under a [Creative Commons Attribution 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/)."
|
||||
#googleAnalytics = "UA-123-45"
|
||||
#disqusShortname = "XYW"
|
||||
|
||||
[permalinks]
|
||||
post = "/:year/:month/:title/"
|
||||
posts = "/:year/:month/:title/"
|
||||
page = "/:slug/"
|
||||
|
||||
[[menu.sidebar]]
|
||||
|
47
i18n/ar.yaml
Normal file
47
i18n/ar.yaml
Normal file
@ -0,0 +1,47 @@
|
||||
- id: about
|
||||
translation: "عن المُدَوَّنَة"
|
||||
|
||||
- id: home
|
||||
translation: "الصَّفْحَة الرَّئيسِيَّة"
|
||||
|
||||
- id: recentPosts
|
||||
translation: "المَنْشورات الأَخِيرَة"
|
||||
|
||||
- id: readMore
|
||||
translation: "قِرَاءَة المَزِيد ←"
|
||||
|
||||
- id: translations
|
||||
translation: "تَرْجَمَة"
|
||||
|
||||
- id: share
|
||||
translation: "شَارِك"
|
||||
|
||||
- id: paginatorPrevious
|
||||
translation: "الصَّفْحَة السَّابِقَة"
|
||||
|
||||
- id: paginatorNext
|
||||
translation: "الصَّفْحَة التَّالِيَة"
|
||||
|
||||
- id: cookieMessage
|
||||
translation: "هذا المَوْقِع يَسْتَخْدِم مَلَفَّات كُوكِيز"
|
||||
|
||||
- id: cookieLink
|
||||
translation: ".اعْرَف أَكْثَر"
|
||||
|
||||
- id: cookieDismiss
|
||||
translation: "!أُوَافِق"
|
||||
|
||||
- id: backToTop
|
||||
translation: "العَوْدَة إِلَى الاَعْلَى"
|
||||
|
||||
- id: links
|
||||
translation: "الرَِّوَابِط"
|
||||
|
||||
- id: authoredBy
|
||||
translation: "الكاتب"
|
||||
|
||||
- id: postedIn
|
||||
translation: "في"
|
||||
|
||||
- id: comma
|
||||
translation: "،"
|
@ -36,3 +36,9 @@
|
||||
|
||||
- id: links
|
||||
translation: "Линкове"
|
||||
|
||||
- id: authoredBy
|
||||
translation: "от"
|
||||
|
||||
- id: postedIn
|
||||
translation: "в"
|
||||
|
@ -36,3 +36,12 @@
|
||||
|
||||
- id: links
|
||||
translation: "Links"
|
||||
|
||||
- id: authoredBy
|
||||
translation: "by"
|
||||
|
||||
- id: postedIn
|
||||
translation: "in"
|
||||
|
||||
- id: comma
|
||||
translation: ","
|
||||
|
47
i18n/fa.yaml
Normal file
47
i18n/fa.yaml
Normal file
@ -0,0 +1,47 @@
|
||||
- id: about
|
||||
translation: "درباره من"
|
||||
|
||||
- id: home
|
||||
translation: "صفحه اصلی"
|
||||
|
||||
- id: recentPosts
|
||||
translation: "مطالب تازه"
|
||||
|
||||
- id: readMore
|
||||
translation: "بیشتر بخوانید ←"
|
||||
|
||||
- id: translations
|
||||
translation: "ترجمه"
|
||||
|
||||
- id: share
|
||||
translation: "به اشتراک گذاشتن"
|
||||
|
||||
- id: paginatorPrevious
|
||||
translation: "صفحه قبلی"
|
||||
|
||||
- id: paginatorNext
|
||||
translation: "صفحه بعدی"
|
||||
|
||||
- id: cookieMessage
|
||||
translation: "در این سایت از کوکیز استفاده میشود"
|
||||
|
||||
- id: cookieLink
|
||||
translation: ".بیشتر بدانید"
|
||||
|
||||
- id: cookieDismiss
|
||||
translation: "!متوجه شدم"
|
||||
|
||||
- id: backToTop
|
||||
translation: "برگشت به بالا"
|
||||
|
||||
- id: links
|
||||
translation: "لینکها"
|
||||
|
||||
- id: authoredBy
|
||||
translation: "بوسیله"
|
||||
|
||||
- id: postedIn
|
||||
translation: "در"
|
||||
|
||||
- id: comma
|
||||
translation: "،"
|
38
i18n/nl.yaml
Normal file
38
i18n/nl.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
- id: about
|
||||
translation: "Over ons"
|
||||
|
||||
- id: home
|
||||
translation: "Home"
|
||||
|
||||
- id: recentPosts
|
||||
translation: "Recente berichten"
|
||||
|
||||
- id: readMore
|
||||
translation: "Lees verder →"
|
||||
|
||||
- id: translations
|
||||
translation: "Vertalingen"
|
||||
|
||||
- id: share
|
||||
translation: "Delen"
|
||||
|
||||
- id: paginatorPrevious
|
||||
translation: "Vorige pagina"
|
||||
|
||||
- id: paginatorNext
|
||||
translation: "Volgende pagina"
|
||||
|
||||
- id: cookieMessage
|
||||
translation: "Deze website gebruikt cookies."
|
||||
|
||||
- id: cookieLink
|
||||
translation: "Lees hier meer"
|
||||
|
||||
- id: cookieDismiss
|
||||
translation: "OK"
|
||||
|
||||
- id: backToTop
|
||||
translation: "Terug naar boven"
|
||||
|
||||
- id: links
|
||||
translation: "Links"
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Lang }}">
|
||||
<html lang="{{ .Lang }}" {{ if or (eq .Lang "ar") (eq .Lang "fa") }}dir="rtl"{{ end }}>
|
||||
|
||||
<head>
|
||||
{{ partial "head-meta.html" . }}
|
||||
@ -12,14 +12,25 @@
|
||||
|
||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||
|
||||
{{ if or (eq .Lang "ar") (eq .Lang "fa") }}
|
||||
{{ "<!-- RTL -->" | safeHTML }}
|
||||
{{ $styleRtl := resources.Get "css/style.rtl.css" | resources.Fingerprint }}
|
||||
<link href="{{ $styleRtl.Permalink }}" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ $styleRtl.Data.Integrity }}" crossorigin="anonymous"{{ end }}>
|
||||
{{ else }}
|
||||
{{ "<!-- combined, minified CSS -->" | safeHTML }}
|
||||
<link href="{{ .Site.BaseURL }}css/style.css" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.style}}" crossorigin="anonymous"{{ end }}>
|
||||
|
||||
{{ if .RSSLink }}
|
||||
{{ "<!-- RSS 2.0 feed -->" | safeHTML }}
|
||||
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
|
||||
{{ $style := resources.Get "css/style.css" | resources.Fingerprint }}
|
||||
<link href="{{ $style.Permalink }}" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous"{{ end }}>
|
||||
{{ end }}
|
||||
|
||||
{{ "<!-- minified Font Awesome for SVG icons -->" | safeHTML }}
|
||||
{{ $fontawesome := resources.Get "js/fontawesome.min.js" | resources.Fingerprint }}
|
||||
<script defer src="{{ $fontawesome.Permalink }}" integrity="{{ $fontawesome.Data.Integrity }}" crossorigin="anonymous"></script>
|
||||
|
||||
{{ "<!-- RSS 2.0 feed -->" | safeHTML }}
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
|
||||
{{ if .Site.Params.cookie_consent_info_url }}
|
||||
@ -50,8 +61,8 @@
|
||||
{{ if (ne .Site.Params.header_visible false) }}
|
||||
<header class="blog-header">
|
||||
<div class="container">
|
||||
<h1 class="blog-title"><a href="{{ .Site.BaseURL }}" rel="home">{{ .Site.Title | safeHTML }}</a></h1>
|
||||
{{ if .Site.Params.description }}<p class="lead blog-description">{{ .Site.Params.description | markdownify }}</p>{{ end }}
|
||||
<h1 class="blog-title" dir="auto"><a href="{{ .Site.BaseURL | absURL }}" rel="home">{{ .Site.Title | safeHTML }}</a></h1>
|
||||
{{ if .Site.Params.description }}<p class="lead blog-description" dir="auto">{{ .Site.Params.description | markdownify }}</p>{{ end }}
|
||||
</div>
|
||||
</header>
|
||||
{{ end }}
|
||||
@ -76,7 +87,7 @@
|
||||
|
||||
{{ block "footer" . }}
|
||||
<footer class="blog-footer">
|
||||
<p>
|
||||
<p dir="auto">
|
||||
{{ if .Site.Copyright }}
|
||||
{{ .Site.Copyright | markdownify }}
|
||||
{{ else }}
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
<article class="blog-post">
|
||||
<header>
|
||||
<h2 class="blog-post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
||||
<p class="blog-post-meta"><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format $dateFormat }}</time> by {{ .Params.author | default .Site.Params.author }}{{ if or (.Params.categories) (.Params.tags) }} in {{ partial "meta-terms.html" . }}{{ end }}</p>
|
||||
<h2 class="blog-post-title" dir="auto"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
||||
<p class="blog-post-meta"><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format $dateFormat }}</time> {{ i18n "authoredBy" }} {{ .Params.author | default .Site.Params.author }}{{ if or (.Params.categories) (.Params.tags) }} {{ i18n "postedIn" }} {{ partial "meta-terms.html" . }}{{ end }}</p>
|
||||
</header>
|
||||
{{ .Content }}
|
||||
</article> <!-- /.blog-post -->
|
||||
|
@ -4,24 +4,21 @@
|
||||
"@context": "http://schema.org",
|
||||
"@type": "Blog",
|
||||
{{- /* Google recommends the headline be no more than 110 characters */}}
|
||||
"headline": "{{ substr .Site.Title 0 110 }}",
|
||||
"url" : "{{ printf "%s" .Permalink }}",
|
||||
"headline": {{ substr .Site.Title 0 110 }},
|
||||
"url" : {{ printf "%s" .Permalink }},
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ .Site.Params.author }}"
|
||||
"name": {{ .Site.Params.author }}
|
||||
},
|
||||
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
|
||||
{{- if not .Date.IsZero }}
|
||||
"dateModified": "{{ .Date.Format $ISO8601 }}",
|
||||
{{- end }}
|
||||
{{- with .Site.Social.GooglePlus }}
|
||||
"publisher": "{{ printf "%s" . }}",
|
||||
"dateModified": {{ .Date.Format $ISO8601 }},
|
||||
{{- end }}
|
||||
{{- /* all of the site's categories/tags, from Hugo's tpl/template_embedded.go */}}
|
||||
"keywords": "{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}"
|
||||
"keywords": {{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}
|
||||
{{- with .Site.Params.description -}}
|
||||
,
|
||||
"description": "{{- . -}}"
|
||||
"description": {{- . -}}
|
||||
{{- end }}
|
||||
}
|
||||
</script>
|
||||
|
@ -6,11 +6,11 @@
|
||||
"@context": "http://schema.org",
|
||||
"@type": "BlogPosting",
|
||||
{{- /* Google recommends the headline be no more than 110 characters */}}
|
||||
"headline": "{{ substr .Title 0 110 }}",
|
||||
"headline": {{ substr .Title 0 110 }},
|
||||
{{- with .Params.images -}}{{ range first 1 . }}
|
||||
"image": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ . | absURL }}"
|
||||
"url": {{ . | absURL }}
|
||||
{{- /* Don't try to get imageConfig if image param is not local */ -}}
|
||||
{{- if not (or (hasPrefix . "http://") (hasPrefix . "https://")) -}}
|
||||
{{- with (imageConfig (printf "/static/%s" .)) -}}
|
||||
@ -21,32 +21,29 @@
|
||||
{{ end }}
|
||||
},
|
||||
{{- end -}}{{ end }}
|
||||
"url": "{{ printf "%s" .Permalink }}",
|
||||
"url": {{ printf "%s" .Permalink }},
|
||||
"wordCount": "{{ .WordCount }}",
|
||||
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
|
||||
{{- if not .PublishDate.IsZero }}
|
||||
"datePublished": "{{ .PublishDate.Format $ISO8601 }}",
|
||||
"datePublished": {{ .PublishDate.Format $ISO8601 }},
|
||||
{{- else }}
|
||||
"datePublished": "{{ .Date.Format $ISO8601 }}",
|
||||
"datePublished": {{ .Date.Format $ISO8601 }},
|
||||
{{- end }}
|
||||
{{- if not .Lastmod.IsZero }}
|
||||
"dateModified": "{{ .Lastmod.Format $ISO8601 }}",
|
||||
{{- end }}
|
||||
{{- with .Site.Social.GooglePlus }}
|
||||
"publisher": "{{ printf "%s" . }}",
|
||||
"dateModified": {{ .Lastmod.Format $ISO8601 }},
|
||||
{{- end }}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ .Params.author | default .Site.Params.author }}"
|
||||
"name": {{ .Params.author | default .Site.Params.author }}
|
||||
}
|
||||
{{- if or (.Params.keywords) (or (.Params.categories) (.Params.tags)) -}}
|
||||
,
|
||||
"keywords": "{{ delimit (union .Params.keywords (union .Params.categories .Params.tags)) ", " }}"
|
||||
"keywords": {{ delimit (union .Params.keywords (union .Params.categories .Params.tags)) ", " }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Params.description -}}
|
||||
,
|
||||
"description": "{{ . }}"
|
||||
"description": {{ . }}
|
||||
{{- end }}
|
||||
}
|
||||
</script>
|
||||
@ -58,8 +55,8 @@
|
||||
|
||||
<article class="blog-post">
|
||||
<header>
|
||||
<h2 class="blog-post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
||||
<p class="blog-post-meta"><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format $dateFormat }}</time> by {{ .Params.author | default .Site.Params.author }}{{ if or (.Params.categories) (.Params.tags) }} in {{ partial "meta-terms.html" . }}{{ end }}</p>
|
||||
<h2 class="blog-post-title" dir="auto"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
||||
<p class="blog-post-meta"><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format $dateFormat }}</time> {{ i18n "authoredBy" }} {{ .Params.author | default .Site.Params.author }}{{ if or (.Params.categories) (.Params.tags) }} {{ i18n "postedIn" }} {{ partial "meta-terms.html" . }}{{ end }}</p>
|
||||
</header>
|
||||
{{ .Content }}
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
<article class="blog-post">
|
||||
<header>
|
||||
<h2 class="blog-post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
||||
<p class="blog-post-meta"><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format $dateFormat }}</time> by {{ .Params.author | default .Site.Params.author }}{{ if or (.Params.categories) (.Params.tags) }} in {{ partial "meta-terms.html" . }}{{ end }}</p>
|
||||
<h2 class="blog-post-title" dir="auto"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
||||
<p class="blog-post-meta"><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format $dateFormat }}</time> {{ i18n "authoredBy" }} {{ .Params.author | default .Site.Params.author }}{{ if or (.Params.categories) (.Params.tags) }} {{ i18n "postedIn" }} {{ partial "meta-terms.html" . }}{{ end }}</p>
|
||||
</header>
|
||||
{{ .Summary }}
|
||||
<a href='{{ .Permalink }}'>{{ i18n "readMore" }}</a>
|
||||
|
@ -1,5 +1,7 @@
|
||||
<link href="{{ .Site.BaseURL }}css/cookieconsent.min.css" rel="stylesheet" type="text/css"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.cookieconsentcss }}" crossorigin="anonymous"{{ end }}>
|
||||
<script src="{{ .Site.BaseURL }}js/cookieconsent.min.js"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.cookieconsentjs }}" crossorigin="anonymous"{{ end }} async></script>
|
||||
{{ $cookieConsentStyle := resources.Get "css/cookieconsent.min.css" | resources.Fingerprint }}
|
||||
<link href="{{ $cookieConsentStyle.Permalink }}" rel="stylesheet" type="text/css"{{ if not .Site.Params.disable_sri }} integrity="{{ $cookieConsentStyle.Data.Integrity }}" crossorigin="anonymous"{{ end }}>
|
||||
{{ $cookieConsentScript := resources.Get "js/cookieconsent.min.js" | resources.Fingerprint }}
|
||||
<script src="{{ $cookieConsentScript.Permalink }}"{{ if not .Site.Params.disable_sri }} integrity="{{ $cookieConsentScript.Data.Integrity }}" crossorigin="anonymous"{{ end }} async></script>
|
||||
|
||||
<script>
|
||||
window.addEventListener("load", function(){
|
||||
|
@ -16,6 +16,6 @@
|
||||
<meta name="yandex-verification" content="{{ . }}" />
|
||||
{{ end }}
|
||||
|
||||
{{- .Hugo.Generator -}}
|
||||
{{- .Site.Hugo.Generator -}}
|
||||
|
||||
{{- /* vim: set ts=2 sw=2 et: */}}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{{ if .Params.categories }}
|
||||
<i class="fa fa-folder" aria-hidden="true"></i> {{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}, {{ end }}<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" rel="category tag">{{ . }}</a>{{ end }}
|
||||
<span class="fas fa-folder" aria-hidden="true"></span> {{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}/" rel="category tag">{{ . }}</a>{{ end }}
|
||||
{{ end }}
|
||||
{{ if .Params.tags }}
|
||||
<i class="fa fa-tag" aria-hidden="true"></i> {{ range $index, $tag := .Params.tags }}{{ if gt $index 0 }}, {{ end }}<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}" rel="tag">{{ . }}</a>{{ end }}
|
||||
<span class="fas fa-tag" aria-hidden="true"></span> {{ range $index, $tag := .Params.tags }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}/" rel="tag">{{ . }}</a>{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{- /* vim: set ts=2 sw=2 et: */}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<h4>{{ i18n "recentPosts" }}</h4>
|
||||
<ol class="list-unstyled">
|
||||
{{ $num_recent_posts := (index .Site.Params.sidebar "num_recent_posts" | default 5) }}
|
||||
{{ range first $num_recent_posts (where .Site.Pages "Section" "in" .Site.Params.mainSections) }}
|
||||
{{ range first $num_recent_posts (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
|
||||
<li><a href="{{.RelPermalink}}">{{.Title | markdownify }}</a></li>
|
||||
{{ end }}
|
||||
</ol>
|
||||
|
@ -1,10 +1,9 @@
|
||||
<section>
|
||||
<h4>{{ i18n "share" }}</h4>
|
||||
<nav class="nav sharing-icons">
|
||||
<a class="nav-item" href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" title="Share on Facebook"><span class="fa fa-facebook fa-2x" aria-hidden="true"></span></a>
|
||||
<a class="nav-item" href="https://plus.google.com/share?url={{ .Permalink }}" title="Share on Google+"><span class="fa fa-google-plus fa-2x" aria-hidden="true"></span></a>
|
||||
<a class="nav-item" href="https://www.linkedin.com/shareArticle?mini=true&url={{ .Permalink }}" title="Share on LinkedIn"><span class="fa fa-linkedin fa-2x" aria-hidden="true"></span></a>
|
||||
<a class="nav-item" href="https://twitter.com/home?status={{ .Permalink }}" title="Tweet this"><span class="fa fa-twitter fa-2x"></span></a>
|
||||
<a class="nav-item" href="https://www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" title="Share on Facebook"><span class="fab fa-facebook-f fa-2x" aria-hidden="true"></span></a>
|
||||
<a class="nav-item" href="https://www.linkedin.com/shareArticle?mini=true&url={{ .Permalink }}" title="Share on LinkedIn"><span class="fab fa-linkedin-in fa-2x" aria-hidden="true"></span></a>
|
||||
<a class="nav-item" href="https://twitter.com/intent/tweet?url={{ .Permalink }}&text={{ .Title }}" title="Tweet this"><span class="fab fa-twitter fa-2x"></span></a>
|
||||
</nav>
|
||||
</section>
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
{{ if and (.Site.Params.sidebar) (isset .Site.Params.sidebar "about") }}
|
||||
<section class="sidebar-module sidebar-module-inset">
|
||||
<h4>{{ i18n "about" }}</h4>
|
||||
<p>{{ .Site.Params.sidebar.about | markdownify }}</p>
|
||||
<p dir="auto">{{ .Site.Params.sidebar.about | markdownify }}</p>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
Sitemap: {{ .Site.BaseURL }}sitemap.xml
|
||||
Sitemap: {{ "sitemap.xml" | absURL }}
|
||||
|
||||
User-agent: *
|
||||
|
4190
package-lock.json
generated
4190
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
27
package.json
27
package.json
@ -1,27 +1,32 @@
|
||||
{
|
||||
"name": "hugo-theme-bootstrap4-blog",
|
||||
"version": "1.1.7",
|
||||
"version": "1.4.1",
|
||||
"description": "A Bootstrap v4 theme for the Hugo static site generator.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/alanorth/hugo-theme-bootstrap4-blog.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build:css": "node-sass --output-style expanded --precision 6 source/scss/style.scss static/css/style.css.tmp && cleancss --level 1 static/css/style.css.tmp -o static/css/style.css",
|
||||
"build:fonts": "cp node_modules/font-awesome/fonts/* static/fonts",
|
||||
"build:cookieconsent": "cp node_modules/cookieconsent/build/cookieconsent.min.css static/css && cp node_modules/cookieconsent/build/cookieconsent.min.js static/js",
|
||||
"build:generatesri": "node build/sri.js > data/sri.toml",
|
||||
"build": "npm run build:css && npm run build:fonts && npm run build:cookieconsent && npm run build:generatesri && npm run clean",
|
||||
"clean": "rm static/css/style.css.tmp"
|
||||
"build:css": "node-sass --output-style expanded --precision 6 source/scss/style.scss assets/css/style.css.tmp && cleancss --level 1 assets/css/style.css.tmp -o assets/css/style.css",
|
||||
"build:rtlcss": "rtlcss -s assets/css/style.css.tmp assets/css/style.rtl.css.tmp && cleancss --level 1 assets/css/style.rtl.css.tmp -o assets/css/style.rtl.css",
|
||||
"build:cookieconsent": "cp node_modules/cookieconsent/build/cookieconsent.min.css assets/css && cp node_modules/cookieconsent/build/cookieconsent.min.js assets/js",
|
||||
"build:js": "webpack",
|
||||
"build": "npm run build:css && npm run build:rtlcss && npm run build:js && npm run build:cookieconsent && npm run clean",
|
||||
"clean": "rm assets/css/style.css.tmp assets/css/style.rtl.css.tmp"
|
||||
},
|
||||
"keywords": "hugo",
|
||||
"author": "Alan Orth",
|
||||
"license": "CC-BY-3.0",
|
||||
"devDependencies": {
|
||||
"bootstrap": "~4.3.1",
|
||||
"clean-css-cli": "^4.2.1",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.27",
|
||||
"@fortawesome/free-brands-svg-icons": "^5.12.1",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.12.1",
|
||||
"bootstrap": "~4.4.1",
|
||||
"clean-css-cli": "^4.3.0",
|
||||
"cookieconsent": "3.0.4",
|
||||
"font-awesome": "^4.7.0",
|
||||
"node-sass": "^4.11.0"
|
||||
"node-sass": "^4.13.1",
|
||||
"rtlcss": "^2.5.0",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11"
|
||||
}
|
||||
}
|
||||
|
13
source/js/fontawesome.js
Normal file
13
source/js/fontawesome.js
Normal file
@ -0,0 +1,13 @@
|
||||
import { library, dom } from '@fortawesome/fontawesome-svg-core'
|
||||
import { faFolder, faTag } from '@fortawesome/free-solid-svg-icons'
|
||||
import { faFacebookF, faTwitter, faLinkedinIn } from '@fortawesome/free-brands-svg-icons'
|
||||
|
||||
// Add solid icons to our library
|
||||
library.add(faFolder, faTag)
|
||||
|
||||
// Add brand icons to our library
|
||||
library.add(faFacebookF, faTwitter, faLinkedinIn)
|
||||
|
||||
// Replace any existing <i> tags with <svg> and set up a MutationObserver to
|
||||
// continue doing this as the DOM changes.
|
||||
dom.watch()
|
2
source/scss/bootstrap.scss
vendored
2
source/scss/bootstrap.scss
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap v4.3.1 (https://getbootstrap.com/)
|
||||
* Bootstrap v4.4.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
|
35
source/scss/font-awesome.scss
vendored
35
source/scss/font-awesome.scss
vendored
@ -1,35 +0,0 @@
|
||||
/*!
|
||||
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
|
||||
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
|
||||
*/
|
||||
|
||||
@import "node_modules/font-awesome/scss/variables";
|
||||
@import "node_modules/font-awesome/scss/mixins";
|
||||
@import "node_modules/font-awesome/scss/path";
|
||||
@import "node_modules/font-awesome/scss/core";
|
||||
@import "node_modules/font-awesome/scss/larger";
|
||||
@import "node_modules/font-awesome/scss/fixed-width";
|
||||
//@import "list";
|
||||
//@import "bordered-pulled";
|
||||
//@import "animated";
|
||||
//@import "rotated-flipped";
|
||||
//@import "stacked";
|
||||
//@import "icons";
|
||||
// selectively import icons we need from font-awesome
|
||||
// see: node_modules/font-awesome/scss/_icons.scss
|
||||
.#{$fa-css-prefix}-tag:before { content: $fa-var-tag; }
|
||||
.#{$fa-css-prefix}-folder:before { content: $fa-var-folder; }
|
||||
.#{$fa-css-prefix}-facebook:before { content: $fa-var-facebook; }
|
||||
.#{$fa-css-prefix}-google-plus:before { content: $fa-var-google-plus; }
|
||||
.#{$fa-css-prefix}-linkedin:before { content: $fa-var-linkedin; }
|
||||
.#{$fa-css-prefix}-rss:before { content: $fa-var-rss; }
|
||||
.#{$fa-css-prefix}-rss-square:before { content: $fa-var-rss-square; }
|
||||
.#{$fa-css-prefix}-twitter:before { content: $fa-var-twitter; }
|
||||
.#{$fa-css-prefix}-y-combinator-square:before,
|
||||
.#{$fa-css-prefix}-yc-square:before,
|
||||
.#{$fa-css-prefix}-hacker-news:before { content: $fa-var-hacker-news; }
|
||||
.#{$fa-css-prefix}-reddit:before { content: $fa-var-reddit; }
|
||||
.#{$fa-css-prefix}-reddit-square:before { content: $fa-var-reddit-square; }
|
||||
.#{$fa-css-prefix}-stumbleupon-circle:before { content: $fa-var-stumbleupon-circle; }
|
||||
.#{$fa-css-prefix}-stumbleupon:before { content: $fa-var-stumbleupon; }
|
||||
@import "node_modules/font-awesome/scss/screen-reader";
|
@ -1,7 +1,3 @@
|
||||
// selectively import components we need from font-awesome
|
||||
// see: node_modules/font-awesome/scss/font-awesome.scss
|
||||
@import 'source/scss/font-awesome';
|
||||
|
||||
// selectively import components we need from bootstrap
|
||||
// see: node_modules/bootstrap/scss/bootstrap.scss
|
||||
@import 'source/scss/bootstrap';
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 434 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,11 +1,11 @@
|
||||
name = "Hugo Bootstrap v4 Blog"
|
||||
license = "CC-BY-3.0"
|
||||
licenselink = "https://github.com/alanorth/hugo-theme-bootstrap4/blob/master/LICENSE.txt"
|
||||
licenselink = "https://github.com/alanorth/hugo-theme-bootstrap4-blog/blob/master/LICENSE.txt"
|
||||
description = "A simple Hugo theme based on the Bootstrap v4 blog example."
|
||||
homepage = "https://github.com/alanorth/hugo-theme-bootstrap4"
|
||||
homepage = "https://github.com/alanorth/hugo-theme-bootstrap4-blog"
|
||||
tags = ["bootstrap", "blog", "font awesome"]
|
||||
features = ["responsive", "blog"]
|
||||
min_version = 0.25
|
||||
min_version = 0.55
|
||||
|
||||
[author]
|
||||
name = "Alan Orth"
|
||||
|
10
webpack.config.js
Normal file
10
webpack.config.js
Normal file
@ -0,0 +1,10 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: './source/js/fontawesome.js',
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'assets/js'),
|
||||
filename: 'fontawesome.min.js'
|
||||
},
|
||||
mode: 'production'
|
||||
};
|
Reference in New Issue
Block a user