Commit c1f35a1a authored by Laura Kalbag's avatar Laura Kalbag
Browse files

move the starter-blog theme into its own repository

parents
Pipeline #918 failed with stages
File added
The MIT License (MIT)
Copyright (c) 2020 YOUR_NAME_HERE
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true # change to draft: false to publish this post
---
\ No newline at end of file
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true # change to draft: false to publish this post
menu:
navigation # include this page in the navigation menu
---
\ No newline at end of file
[copyright]
other = "Copyright"
[tagged]
other = "Tagged with:"
[Pagination]
other = "Pagination"
[pagePrevious]
other = "Previous page"
[pageNext]
other = "Next page"
[pageCurrent]
other = "Current page"
[pageCount]
other = "Page {{ .PageNumber }} of {{ .TotalPages }}"
[gotoPageNumber]
other = "Go to page {{ .PageNumber }}"
\ No newline at end of file
[copyright]
other = "Copyright"
[Pagination]
other = "sayfalara numara koyma"
[pagePrevious]
other = "Önceki sayfa"
[pageNext]
other = "Sonraki Sayfa"
[pageCurrent]
other = "Geçerli sayfa"
[pageCount]
other = "Sayfa {{ .PageNumber }}/{{ .TotalPages }}"
[gotoPageNumber]
other = "{{ .PageNumber }} sayfasına git"
\ No newline at end of file
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
{{ partial "head.html" . }}
</head>
<body {{- if $.Site.Params.homeImage }} class='has-feature-image'{{ end -}}>
<header>
{{ partial "header.html" . }}
</header>
<main id="content">
{{- block "main" . }}{{ end }}
</main>
<footer>
{{ partial "footer.html" . }}
</footer>
</body>
</html>
{{ define "main" }}
<h1>{{ .Title }}</h1>
<!-- Range over the pages in whatever section we are in -->
{{- $posts := .Pages }}
{{ range (.Paginate $posts).Pages.GroupByDate "2006" }}
<h2 class='year'>{{ .Key }}</h2>
<!-- Group by month. -->
{{ range .Pages.GroupByDate "January" }}
<h3 class='month'>{{ .Key }}</h3>
<!-- Group by day -->
{{ range .Pages.GroupByDate "02" }}
<h4 class='day'>{{ .Key }}</h4>
<ul class='posts'>
{{ range $index, $post := .Pages }}
{{ partial "list-post.html" . }}
{{ end }}
</ul>
{{ end }}
{{ end }}
{{ end }}
{{ partial "paginator.html" . }}
{{- end }}
\ No newline at end of file
{{ $pages := "" }}
{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ else }}{{ $pages = .Pages }}{{ end }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ .Site.Title }}</title>
<link>{{ .Permalink }}</link>
<description>Posts from {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ now.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
{{ range $pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}&lt;p&gt;&lt;a href=&#34;{{ .Permalink }}&#34;&gt;Read the original post, &#39;{{ .Title }}&#39;&lt;/a&gt;.&lt;/p&gt;</description>
</item>
{{ end }}
</channel>
</rss>
\ No newline at end of file
{{ define "main" }}
<article>
{{ partial "feature-image.html" . }}
<h1>{{ .Title }}</h1>
{{- if eq .Section "posts" -}}
<p><time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>{{ .Date.Format "02 January 2006" }}</time></p>
{{- end }}
{{ .Content -}}
{{ if (isset .Params "tags")}}
<aside class='tags'>
<p>{{ i18n "tagged" }}
<!-- if the post has tags, range over those tags -->
{{ range $index, $tags := .Params.tags }}
<!-- if there’s more than one tag, separate them with commas -->
{{ if gt $index 0 }}, {{ end }}
<a href='{{ "tags/" | relURL }}{{ . | urlize }}'>{{ . }}</a>
{{ end }}.</p>
</aside>
{{- end }}
</article>
{{- end }}
\ No newline at end of file
{{ define "main" }}
<!-- Template for the Home page -->
{{ partial "feature-image.html" . }}
<!-- Range over the pages and only include the ones that are a post type -->
{{- $posts := where site.RegularPages "Type" "in" site.Params.mainSections }}
<!-- Group by year -->
{{ range (.Paginate $posts).Pages.GroupByDate "2006" }}
<h2 class='year'>{{ .Key }}</h2>
<!-- Group by month. -->
{{ range .Pages.GroupByDate "January" }}
<h3 class='month'>{{ .Key }}</h3>
<!-- Group by day -->
{{ range .Pages.GroupByDate "02" }}
<h4 class='day'>{{ .Key }}</h4>
<ul class='posts'>
{{ range $index, $post := .Pages }}
{{ partial "list-post.html" . }}
{{ end }}
</ul>
{{ end }}
{{ end }}
{{ end }}
{{ partial "paginator.html" . }}
{{ end }}
\ No newline at end of file
{{ if .IsHome }}
{{ $homeFeatureImage := .Site.GetPage "/config" }}
{{ with $homeFeatureImage }}
{{ $imageResource := $homeFeatureImage.Resources.GetMatch "{home.*,*.jpg,*.png,*.jpeg}" }}
{{ with $imageResource }}
{{ $image := .Fill "1800x600" }}
<img class="feature" width="{{ $image.Width }}" height="{{ $image.Height }}" sizes="(min-width: 768px), 98vw" srcset='{{ range $.Site.Params.imageWidths }}
{{- if ge $image.Width . }}
{{ $resized := $image.Resize (printf "%dx" .) }}
{{ $resized.RelPermalink }} {{ . }}w,
{{ end }}
{{ end }}
{{ $image.RelPermalink }} {{ $image.Width }}w' src="{{ .Permalink }}" alt="" />
{{ end }}
{{ end }}
{{ else }}
{{ with .Resources }}
{{ with .GetMatch "{feature.*,*.jpg,*.png,*.jpeg}" }}
{{ $image := .Fill "1800x600" }}
<img class="feature" width="{{ $image.Width }}" height="{{ $image.Height }}"
sizes="(min-width: 768px), 98vw"
srcset='{{ range $.Site.Params.imageWidths }}
{{- if ge $image.Width . }}
{{ $resized := $image.Resize (printf "%dx" .) }}
{{ $resized.RelPermalink }} {{ . }}w,
{{ end }}
{{ end }}
{{ $image.RelPermalink }} {{ $image.Width }}w' src="{{ .Permalink }}" alt="" />
{{ end }}
{{ end }}
{{ end }}
\ No newline at end of file
{{ with $.Site.Params.description }}<p class='site-description'>{{ . }}</p>{{ end }}
<p class='copyright'><small>{{ i18n "copyright" }} &copy; {{ .Site.Title }}, {{ now.Format "2006"}}.</small></p>
\ No newline at end of file
<meta charset='utf-8'>
<title>{{ .Title }}</title>
<meta name='viewport' content='user-scalable=yes, width=device-width, initial-scale = 1'>
<meta name='robots' content='index, follow'>
<link href='{{ "css/style.css" | relURL }}' rel='stylesheet' type='text/css' />
\ No newline at end of file
{{ if .IsHome -}}
<h1 class='site-title'><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
{{ else }}
<h2 class='site-title'><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h2>
{{ end -}}
{{ partial "navigation.html" . }}
\ No newline at end of file
<li>
<article>
<h5>
<a href="{{ .Permalink }}">
{{ .Title }}
</a>
</h5>
<p>{{ .Summary }}</p>
{{ if (isset .Params "tags")}}
<p>{{ i18n "tagged" }}
{{/* if the post has tags, range over those tags */}}
{{ range $index, $tags := .Params.tags -}}
{{/* if there’s more than one tag, separate them with commas */}}
{{- if gt $index 0 }}, {{ end }}
<a href='{{ "tags/" | relURL }}{{ . | urlize }}'>{{ . }}</a>
{{- end }}.</p>
{{- end }}
</article>
</li>
<nav id='site-navigation'>
{{ $currentPage := . -}}
{{ if .Site.Menus.navigation -}}
<ul class='navigation'>
<!-- Determine the current page so we can set active navigation states -->
{{- $current := . -}}
{{ range .Site.Menus.navigation -}}
{{ $active := or ($current.IsMenuCurrent "navigation" .) ($current.HasMenuCurrent "navigation" .) -}}
{{ $active = or $active (eq .Name $current.Title) -}}
<li {{ if $active }}class="active" aria-current="true" {{ end -}}>
<a href='{{ .URL }}'>{{ .Name }}</a>
</li>
{{- end }}
</ul>
{{- end }}
</nav>
\ No newline at end of file
{{/* based on the Hugo pagination template, adjusted to my needs */}}
{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }}
{{ $ellipsed := false }}
{{ $shouldEllipse := false }}
<nav class="pagination" role="navigation" aria-label='{{ i18n "Pagination" }}'>
<ul>
{{ if $pag.HasPrev }}{{/* if there’s a previous page, show link for previous page */}}
<li>
<a class="previous-page" href="{{ $pag.Prev.URL }}">{{ i18n "pagePrevious" }}</a>
</li>
{{ end }}
{{ range $pag.Pagers }}
{{ $right := sub .TotalPages .PageNumber }}
{{ $showNumber := or (le .PageNumber 3) (eq $right 0) }}
{{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) }}
{{ if $showNumber }}
{{ $ellipsed = false }}
{{ $shouldEllipse = false }}
{{ else }}
{{ $shouldEllipse = not $ellipsed }}
{{ $ellipsed = true }}
{{ end }}
{{ if $showNumber }}
{{ if eq . $pag }}{{/* if current page */}}
<li class="number" aria-label='{{ i18n "pageCurrent" }}' aria-current="true">{{ i18n "pageCount" . }}</li>
{{ else }}
<li class="number"><a href="{{ .URL }}" aria-label='{{ i18n "gotoPageNumber" . }}'>{{ .PageNumber }}</a></li>
{{ end }}
{{ else if $shouldEllipse }}
<li class="ellipsis"><span aria-hidden="true">&nbsp;&hellip;&nbsp;</span></li>
{{ end }}
{{ end }}
{{ if $pag.HasNext }}{{/* if there’s a next page, show link for next page */}}
<li>
<a class="next-page" href="{{ $pag.Next.URL }}">{{ i18n "pageNext" }}</a>
</li>
{{ end }}
</ul>
</nav>
{{ end }}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment