Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for codecolor customization and w3 compliant favicon paths #29

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,16 @@ copyright = "© Copyright Year, Your Name"
header_title = "Your Name" # Your header title
header_subtitle = "Your Creative Subtitle" # Your header subtitle
home_image = "/images/avatar.png" # Path to header image starting from the static directory (optional)
favicon = "/favicon.ico" # Path to favicon image starting from static. Defaults to "./favicon.ico"
favicon_type = "x-icon" # Image extension. Defaults to x-icon
recent_posts = 5 # Max amount of recent posts to show
mainSections = ["posts", "post", "blog"] # Main sections to include in recent posts
[params.style] # CSS style overrides
backgroundColor = "#f8f9fa"
homeImageBorderColor = "#ffffff"
fontFamilyBase = "Helvetica Neue" # First-choice font
fontColor = "#212529"
codeColor = "#e83e8c"
[[params.social]]
fa_icon = "fab fa-github fa-1x" # Font Awesome icon class
href = "http://github.com/youruser" # Link to associate with icon (http://, https://, mailto:)
Expand Down
1 change: 1 addition & 0 deletions assets/sass/override.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $body-color: {{ if .Param "style.fontColor" }}{{ .Param "style.fontColor"}}{{ el
$home-image-border-color: {{ if .Param "style.homeImageBorderColor" }}{{ .Param "style.homeImageBorderColor"}}{{ else }}#ffffff{{ end }};
$font-family-base: {{ if .Param "style.fontFamilyBase"}}{{ .Param "style.fontFamilyBase"}},{{end}}"Helvetica Neue", Arial, sans-serif;
$font-size-base: 0.95rem;
$code-color: {{ if .Param "style.codeColor" }}{{ .Param "style.codeColor"}}{{ else }}"inherit"{{ end }};
@import "../../node_modules/bootstrap/scss/bootstrap";

// === Import Font Awesome ===
Expand Down
7 changes: 7 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />

{{/* Adds favicon specification to config.toml */}}
<link rel="icon" type= {{
if $.Site.Params.favicon_type }}{{ path.Join "image/" $.Site.Params.favicon_type }}{{ else }}{{ "image/x-icon" }}{{end
}} href= {{
if $.Site.Params.favicon }}{{ $.Site.Params.favicon }}{{ else }}{{ "/favicon.ico" }}{{end
}}>

{{/* Adds complete override capability */}}
{{ $overrideTemplate := resources.Get "sass/override.scss" }}
{{ $override := $overrideTemplate | resources.ExecuteAsTemplate "css/theme.scss" . | toCSS | minify }}
Expand Down