From 2e677d5a7a9649327092be734d08c208daa96018 Mon Sep 17 00:00:00 2001 From: Ryan Watters Date: Thu, 9 Feb 2017 00:07:31 -0600 Subject: [PATCH] Update styles for code blocks --- content/about-hugo/roadmap.md | 10 +- content/about-hugo/sample-styles-temporary.md | 141 ++++--- content/contribute-to-hugo/_index.md | 2 +- content/project-organization/_index.md | 6 +- content/project-organization/configuration.md | 13 +- content/templates/list-page-template.md | 4 +- themes/hugodocs/layouts/_default/baseof.html | 2 +- themes/hugodocs/layouts/_default/single.html | 2 +- themes/hugodocs/layouts/index.html | 2 +- .../layouts/partials/site-footer.html | 2 +- .../layouts/partials/site-header.html | 5 +- .../{godoc-icon.svg => godoc-icon.html} | 0 .../pipeline/js/scripts/highlight.pack.js | 368 ++++++++++++++++++ themes/hugodocs/pipeline/js/scripts/prism.js | 35 +- .../hugodocs/pipeline/js/scripts/site-menu.js | 2 +- themes/hugodocs/pipeline/scss/_variables.scss | 22 +- .../pipeline/scss/components/_code.scss | 319 +++++++-------- .../_note-caution-and-warning-shortcodes.scss | 8 +- .../pipeline/scss/components/_tags.scss | 4 +- .../pipeline/scss/pages/_homepage.scss | 5 +- themes/hugodocs/pipeline/scss/style.scss | 3 +- .../pipeline/scss/vendor/_highlightjs.scss | 81 ++++ .../hugodocs/pipeline/scss/vendor/_prism.scss | 72 ++-- themes/hugodocs/static/css/style.min.css | 2 +- themes/hugodocs/static/js/script.min.js | 7 +- 25 files changed, 770 insertions(+), 347 deletions(-) rename themes/hugodocs/layouts/partials/svg-icons/{godoc-icon.svg => godoc-icon.html} (100%) create mode 100644 themes/hugodocs/pipeline/js/scripts/highlight.pack.js create mode 100644 themes/hugodocs/pipeline/scss/vendor/_highlightjs.scss diff --git a/content/about-hugo/roadmap.md b/content/about-hugo/roadmap.md index 87f9e62ce..6612465ba 100644 --- a/content/about-hugo/roadmap.md +++ b/content/about-hugo/roadmap.md @@ -2,9 +2,9 @@ title: Roadmap linktitle: description: Information on the Hugo license. -date: 2016-11-01 -publishdate: 2016-11-01 -lastmod: 2016-11-01 +date: 2017-02-01 +publishdate: 2017-02-01 +lastmod: 2017-02-01 tags: [] weight: 40 draft: false @@ -24,8 +24,8 @@ In no particular order, here is what is currently being worked on for the Hugo p * Native support for additional content formats (AsciiDoc [#1435][], reST [#1436][]) * And, last but not least, *your* best ideas! -{{% note title="Contributions Welcome" %}} -Feel free to [contribute](/tutorials/how-to-contribute-to-hugo/) or open a new issue if you have an idea for a new feature. +{{% note "Contributions Welcome" %}} +Feel free to [contribute](/contribute-to-hugo/) or open a new issue if you have an idea for a new feature. {{% /note %}} [#98]: https://github.com/spf13/hugo/issues/98 diff --git a/content/about-hugo/sample-styles-temporary.md b/content/about-hugo/sample-styles-temporary.md index 42fbb5372..95d1b9d31 100644 --- a/content/about-hugo/sample-styles-temporary.md +++ b/content/about-hugo/sample-styles-temporary.md @@ -12,6 +12,90 @@ aliases: notes: --- +## Code Block Shortcodes + +### Code Input Shortcode + +{{% input "my-first-template.html" %}} +```go + +``` +{{% /input %}} + +{{% input "first-script.js" %}} +```js +function myFunction(arg){ + console.log(arg); +} +``` +{{% /input %}} + +{{% input "config.yml" %}} +```yaml +--- +archetypeDir: "archetypes" +# hostname (and path) to the root, e.g. http://spf13.com/ +baseURL: "" +# include content marked as draft +buildDrafts: false +# include content with publishdate in the future +buildFuture: false +# include content already expired +buildExpired: false +# enable this to make all relative URLs relative to content root. Note that this does not affect absolute URLs. +relativeURLs: false +canonifyURLs: false +... +``` +{{% /input %}} + +### Code Output Shortcode + +{{% output "/posts/index.html" %}} +```html + +``` +{{% /output %}} + +{{% output "/first-data.json" %}} +```json +{ + "glossary": { + "title": "example glossary", + "GlossDiv": { + "title": "S" + } + } +} +``` +{{% /output %}} + +{{% output "/script.js" %}} +```javascript +$('my-div').on('click',function(evt){ + evt.preventDefault(); + console.log('Hello world!'); +}); +``` +{{% /output %}} + +### Markdown Code Block without Shortcode + +```javascript +function myFunction(val){ + console.log(val); +} +``` + + Here is some body copy. Here is a bit of `inline code`. Here is a [link to Google](https://www.google.com). Here is some *emphasized and italics text*. Here is some **emphasized and bold text**. ## Lists @@ -44,59 +128,4 @@ Here is *something in italic* in a shortcode. Here is **something in bold**. {{% warning "Warning Shortcode" %}} Here is *something in italic* in a shortcode. Here is **something in bold**. -{{% /warning %}} - -## Code Block Shortcodes - -### Code Input Shortcode - -{{% input "my-first-template.html" %}} -```go - -``` -{{% /input %}} - -{{% input "first-script.js" %}} -```js -function myFunction(arg){ - console.log(arg); -} -``` -{{% /input %}} - -### Code Output Shortcode - -{{% output "/posts/index.html" %}} -```go - -``` -{{% /output %}} - -{{% output "/first-data.json" %}} -```json -{ - "glossary": { - "title": "example glossary", - "GlossDiv": { - "title": "S" - } - } -} -``` -{{% /output %}} - -### Markdown Code Block without Shortcode - -```javascript -function myFunction(val){ - console.log(val); -} -``` +{{% /warning %}} \ No newline at end of file diff --git a/content/contribute-to-hugo/_index.md b/content/contribute-to-hugo/_index.md index 325fbd0d7..620590f1a 100644 --- a/content/contribute-to-hugo/_index.md +++ b/content/contribute-to-hugo/_index.md @@ -11,6 +11,6 @@ authorprofileurl: weight: draft: false slug: -aliases: +aliases: [/tutorials/how-to-contribute-to-hugo/] notes: --- \ No newline at end of file diff --git a/content/project-organization/_index.md b/content/project-organization/_index.md index 42836b675..5f388171b 100644 --- a/content/project-organization/_index.md +++ b/content/project-organization/_index.md @@ -1,5 +1,5 @@ --- -title: New Project Scaffolding +title: New Project Scaffolding and Directory Structure linktitle: description: Scaffolding new projects, configuration, and source organization. date: 2016-11-01 @@ -14,3 +14,7 @@ aliases: notes: --- +## New Projects + +## Hugo Directory Structure + diff --git a/content/project-organization/configuration.md b/content/project-organization/configuration.md index 24f0d69e7..28de1eefc 100644 --- a/content/project-organization/configuration.md +++ b/content/project-organization/configuration.md @@ -127,6 +127,8 @@ enableRobotsTXT: false disable404: false # Do not inject generator meta tag on homepage disableHugoGeneratorInject: false +# Do not make the url/path to lowercase +disablePathToLower: false # edit new content with this editor, if provided editor: "" # Enable Emoji emoticons support for page content. @@ -138,6 +140,8 @@ footnoteAnchorPrefix: "" footnoteReturnLinkContents: "" # google analytics tracking id googleAnalytics: "" +# if true, auto-detect Chinese/Japanese/Korean Languages in the content. (.Summary and .WordCount can work properly in CJKLanguage) +hasCJKLanguage: false languageCode: "" layoutDir: "layouts" # Enable Logging @@ -179,10 +183,6 @@ theme: "" title: "" # if true, use /filename.html instead of /filename/ uglyURLs: false -# Do not make the url/path to lowercase -disablePathToLower: false -# if true, auto-detect Chinese/Japanese/Korean Languages in the content. (.Summary and .WordCount can work properly in CJKLanguage) -hasCJKLanguage: false # verbose output verbose: false # verbose logging @@ -203,6 +203,11 @@ ignoreFiles = [ "\\.foo$", "\\.boo$" ] ``` The above is a list of regular expressions. Note that the backslash (`\`) character is escaped in this example to keep TOML happy. +## See Also + +* [TOML Spec][] + [`.Site.Params`]: /variables-and-params/ [templates]: /templates +[TOML Spec]: https://github.com/toml-lang/toml [directory structure]: /project-organization/directory-structure \ No newline at end of file diff --git a/content/templates/list-page-template.md b/content/templates/list-page-template.md index fb27747e1..fa2296098 100644 --- a/content/templates/list-page-template.md +++ b/content/templates/list-page-template.md @@ -11,4 +11,6 @@ draft: false slug: aliases: notes: ---- \ No newline at end of file +--- + +## List Page Lookup Order \ No newline at end of file diff --git a/themes/hugodocs/layouts/_default/baseof.html b/themes/hugodocs/layouts/_default/baseof.html index a760987e1..d6a256c82 100644 --- a/themes/hugodocs/layouts/_default/baseof.html +++ b/themes/hugodocs/layouts/_default/baseof.html @@ -3,7 +3,7 @@ {{- partial "site-head.html" . -}} {{- partial "site-header.html" . -}} -
+
{{ block "main" . }} {{ end}}
diff --git a/themes/hugodocs/layouts/_default/single.html b/themes/hugodocs/layouts/_default/single.html index 0a671681d..bd569b2b5 100644 --- a/themes/hugodocs/layouts/_default/single.html +++ b/themes/hugodocs/layouts/_default/single.html @@ -7,7 +7,7 @@ Edit Page {{- if .Params.godocref -}} GoDocs - {{ partial "svg-icons/godoc-icon.svg" .}} + {{ partial "svg-icons/godoc-icon.html" .}} {{- end -}}
diff --git a/themes/hugodocs/layouts/index.html b/themes/hugodocs/layouts/index.html index 6f831e29b..d62123fd2 100644 --- a/themes/hugodocs/layouts/index.html +++ b/themes/hugodocs/layouts/index.html @@ -6,7 +6,7 @@