SlideShare a Scribd company logo
1 of 18
Download to read offline
Hugo
генератор статичных сайтов
Николай Сасковец
shurph@gmail.com
github.com/shurph
twitter.com/shurph
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
staticgen.com
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Hugo
* проект стартовал в 2013 году
активно развивается
** меньше 1мс/1страница
меньше 1с на весь сайт
свежий* и быстрый**
генератор статичных сайтов
написанный на Golang
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Кто использует Hugo
и кто спонсирует
Используют
●
Linode Docs
●
Let's Encrypt
●
1Password Support
Спонсируют
●
Linode
●
Forestry
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Кто разрабатывает Hugo
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Возможности Hugo
●
Шаблоны
●
Компоненты
●
Постраничная
разбивка
●
«Таксономия» (теги)
●
YAML, JSON, TOML
для конфигурации
●
Markdown для
текста
●
«короткие коды»
как расширение
Markdown
(shortcodes)
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Установка
или
просто скачайте бинарник
под вашу платформу
github.com/gohugoio
sudo apt-get install hugo
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Создание нового сайта
hugo new site example2018
cd example2018/
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Создание нового сайта
git init
git submodule add 
> https://github.com/budparr/gohugo-theme-ananke.git 
> themes/ananke
echo 'theme = "ananke"' >> config.toml
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Генерация сайта
hugo
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Существующий сайт
git clone https://github.com/shurph/orsha-lug-hugo.git
cd orsha-lug-hugo/
git submodule init
git submodule update
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Структура «исходника» сайта.
├── archetypes
│   └── default.md
├── config.yaml
├──────────────────────────── content
├── layouts      ├── article
│   └── partials      │   └── *
│   └── footer.html  └── post
│         └── *
├──────────────────────────── static
│       ├─────────────── archive
└── themes      ├── favicon.ico ├── images
└── beautifulhugo     ├── forum │ └── *
      ├─ ...       │   └── * └── *
  └─ layouts    ├── .htaccess
  ├─ ...  ├── images
  └─ partials   │   └── *
  ├─ footer.html ├── robots.txt
  └─ *   ├── sitemap_forum.xml
       └── sitemap_index.xml
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
<ul class="list-inline text-center footer-links">
{{ range .Site.Data.beautifulhugo.social.social_icons }}
{{- if isset $.Site.Author .id }}
<li><a href="{{ printf .url (index $.Site.Author .id)
}}">{{ .title }}</a></li>
{{- end -}}
{{ end }}
{{ if .RSSLink }}
<a href="{{ .RSSLink }}" title="RSS">RSS</a>
{{ else }}
No RSS, sorry
{{ end }}
</ul>
{{- partial "footer_custom.html" . }}
Пример шаблона
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
---
title: "Начало положено"
date: 2008-07-08T20:36:10+03:00
tags: ["lug", "linux", "orsha"]
categories: ["cat1", "cat2"]
---
Всем привет
===========
![](/images/articles/img.jpg)
**Вот так** мы провели _этот день_:
![Картинка с тайтлом](http://example.net/img.png)
И немного видео:
{{< youtube d0NxgHQmKdA >}}
Пример markdown-страницы
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Вставка видео с ютуба:
{{< youtube d0NxgHQmKdA >}}
Вставка фотографий из instagram:
{{< instagram BWNjjyYFxVx >}}
Вставка gist из github:
{{< gist spf13 7896402 "img.html" >}}
Подсветка кода:
{{< highlight go >}}
// какой-то код на Go, например:
archetypeFilename := findArchetype(ps, kind, ext)
{{< /highlight >}}
... и многое другое
Что умеют shortcodes
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
# TOML:
baseurl = "https://orsha.linux.by/"
title = "Orsha LUG"
theme = "beautifulhugo"
[[menu.main]]
name = "Форум"
url = "/forum/"
weight = -1
[[menu.main]]
name = "Статьи"
url = "/article/"
weight = 2
Конфигурационный файл
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
# YAML:
baseURL: "https://orsha.linux.by/"
title: "Orsha LUG"
theme: "beautifulhugo"
metaDataFormat: "yaml"
menu:
main:
- Name: "Форум"
Weight: -1
URL: "/forum/"
- Name: "Статьи"
Weight: 2
URL: "/article/"
Ссылки
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
- Сайт Orsha LUG
https://orsha.linux.by/
- Исходники сайта
https://github.com/shurph/orsha-lug-hugo
- Документация Hugo
http://gohugo.io/getting-started/
- Темы оформления для Hugo
https://themes.gohugo.io/
Hugo
генератор статичных сайтов
2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
Николай Сасковец
shurph@gmail.com
github.com/shurph
twitter.com/shurph
FIN!

More Related Content

Featured

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Hugo — генератор статичных сайтов (Hugo — static site generator)

  • 1. Hugo генератор статичных сайтов Николай Сасковец shurph@gmail.com github.com/shurph twitter.com/shurph 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 2. staticgen.com 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 3. Hugo * проект стартовал в 2013 году активно развивается ** меньше 1мс/1страница меньше 1с на весь сайт свежий* и быстрый** генератор статичных сайтов написанный на Golang 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 4. Кто использует Hugo и кто спонсирует Используют ● Linode Docs ● Let's Encrypt ● 1Password Support Спонсируют ● Linode ● Forestry 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 5. Кто разрабатывает Hugo 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 6. Возможности Hugo ● Шаблоны ● Компоненты ● Постраничная разбивка ● «Таксономия» (теги) ● YAML, JSON, TOML для конфигурации ● Markdown для текста ● «короткие коды» как расширение Markdown (shortcodes) 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 7. Установка или просто скачайте бинарник под вашу платформу github.com/gohugoio sudo apt-get install hugo 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 8. Создание нового сайта hugo new site example2018 cd example2018/ 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 9. Создание нового сайта git init git submodule add > https://github.com/budparr/gohugo-theme-ananke.git > themes/ananke echo 'theme = "ananke"' >> config.toml 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 10. Генерация сайта hugo 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 11. Существующий сайт git clone https://github.com/shurph/orsha-lug-hugo.git cd orsha-lug-hugo/ git submodule init git submodule update 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 12. Структура «исходника» сайта. ├── archetypes │   └── default.md ├── config.yaml ├──────────────────────────── content ├── layouts      ├── article │   └── partials      │   └── * │   └── footer.html  └── post │         └── * ├──────────────────────────── static │       ├─────────────── archive └── themes      ├── favicon.ico ├── images └── beautifulhugo     ├── forum │ └── *       ├─ ...       │   └── * └── *   └─ layouts    ├── .htaccess   ├─ ...  ├── images   └─ partials   │   └── *   ├─ footer.html ├── robots.txt   └─ *   ├── sitemap_forum.xml        └── sitemap_index.xml 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 13. <ul class="list-inline text-center footer-links"> {{ range .Site.Data.beautifulhugo.social.social_icons }} {{- if isset $.Site.Author .id }} <li><a href="{{ printf .url (index $.Site.Author .id) }}">{{ .title }}</a></li> {{- end -}} {{ end }} {{ if .RSSLink }} <a href="{{ .RSSLink }}" title="RSS">RSS</a> {{ else }} No RSS, sorry {{ end }} </ul> {{- partial "footer_custom.html" . }} Пример шаблона 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 14. --- title: "Начало положено" date: 2008-07-08T20:36:10+03:00 tags: ["lug", "linux", "orsha"] categories: ["cat1", "cat2"] --- Всем привет =========== ![](/images/articles/img.jpg) **Вот так** мы провели _этот день_: ![Картинка с тайтлом](http://example.net/img.png) И немного видео: {{< youtube d0NxgHQmKdA >}} Пример markdown-страницы 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 15. Вставка видео с ютуба: {{< youtube d0NxgHQmKdA >}} Вставка фотографий из instagram: {{< instagram BWNjjyYFxVx >}} Вставка gist из github: {{< gist spf13 7896402 "img.html" >}} Подсветка кода: {{< highlight go >}} // какой-то код на Go, например: archetypeFilename := findArchetype(ps, kind, ext) {{< /highlight >}} ... и многое другое Что умеют shortcodes 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo
  • 16. # TOML: baseurl = "https://orsha.linux.by/" title = "Orsha LUG" theme = "beautifulhugo" [[menu.main]] name = "Форум" url = "/forum/" weight = -1 [[menu.main]] name = "Статьи" url = "/article/" weight = 2 Конфигурационный файл 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo # YAML: baseURL: "https://orsha.linux.by/" title: "Orsha LUG" theme: "beautifulhugo" metaDataFormat: "yaml" menu: main: - Name: "Форум" Weight: -1 URL: "/forum/" - Name: "Статьи" Weight: 2 URL: "/article/"
  • 17. Ссылки 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo - Сайт Orsha LUG https://orsha.linux.by/ - Исходники сайта https://github.com/shurph/orsha-lug-hugo - Документация Hugo http://gohugo.io/getting-started/ - Темы оформления для Hugo https://themes.gohugo.io/
  • 18. Hugo генератор статичных сайтов 2018-03-31, Линуксовка MLUG, Николай Сасковец <shurph@gmail.com>, github.com/shurph/orsha-lug-hugo Николай Сасковец shurph@gmail.com github.com/shurph twitter.com/shurph FIN!