GithubHelp home page GithubHelp logo

tighten / jigsaw-blog-template Goto Github PK

View Code? Open in Web Editor NEW
91.0 15.0 41.0 5.46 MB

Starter template for a blog, using Jigsaw by Tighten

Home Page: https://jigsaw.tighten.co

License: MIT License

PHP 12.28% JavaScript 8.11% Vue 13.42% Blade 56.17% CSS 10.02%
jigsaw laravel static-site-generator tailwindcss template blade static-site

jigsaw-blog-template's Introduction

Jigsaw Blog Starter Template

This is a starter template for creating a beautiful, customizable blog in Jigsaw with minimal effort. You’ll only have to change a few settings and you’re ready to go.

View a preview of the blog template.

Installation

After installing Jigsaw, run the following command from your project directory:

./vendor/bin/jigsaw init blog

This starter template includes samples of common page types, and comes pre-configured with:

  • A fully responsive navigation bar
  • Tailwind CSS, a utility CSS framework that allows you to customize your design without touching a line of CSS
  • Purgecss to remove unused selectors from your CSS, resulting in smaller CSS files
  • Syntax highlighting using highlight.js
  • A script that automatically generates a sitemap.xml file
  • A custom 404 page
  • A component for accepting signups for a Mailchimp newsletter
  • A sample contact form
  • A search bar powered by Fuse.js and Vue.js, which indexes your content automatically and requires zero configuration

Blog starter template screenshot


Configuring your new site

As with all Jigsaw sites, configuration settings can be found in config.php; you can update the variables in that file with settings specific to your site. You can also add new configuration variables there to use across your site; take a look at the Jigsaw documentation to learn more.

// config.php
return [
    'baseUrl' => 'https://my-awesome-jigsaw-site.com/',
    'production' => false,
    'siteName' => 'My Site',
    'siteDescription' => 'Give your blog a boost with Jigsaw.',
    ...
];

Tip: This configuration file is also where you’ll define any "collections" (for example, a collection of the contributors to your site, or a collection of blog posts organized by topic). Check out the official Jigsaw documentation to learn more.


Adding Content

You can write your content using a variety of file types. By default, this starter template expects your content to be located in the source/_posts/ folder.

The top of each content page contains a YAML header that specifies how it should be rendered. The title attribute is used to dynamically generate HTML title and OpenGraph tags for each page. The extends attribute defines which parent Blade layout this content file will render with (e.g. _layouts.post will render with source/_layouts/post.blade.php), and the section attribute defines the Blade "section" that expects this content to be placed into it.

---
extends: _layouts.post
section: content
title: Getting Started
date: 2022-08-02
description: Getting started with the Jigsaw blog starter template
cover_image: /assets/img/post-cover-image-2.png
featured: true
---

Adding Assets

Any assets that need to be compiled (such as JavaScript, Less, or Sass files) can be added to the source/_assets/ directory, and Laravel Mix will process them when running npm run dev or npm run prod. The processed assets will be stored in /source/assets/build/ (note there is no underscore on this second assets directory).

Then, when Jigsaw builds your site, the entire /source/assets/ directory containing your built files (and any other directories containing static assets, such as images or fonts, that you choose to store there) will be copied to the destination build folders (build_local, on your local machine).

Files that don't require processing (such as images and fonts) can be added directly to /source/assets/.

Read more about compiling assets in Jigsaw using Laravel Mix.


Building Your Site

Now that you’ve edited your configuration variables and know how to customize your styles and content, let’s build the site.

# build static files with Jigsaw
./vendor/bin/jigsaw build

# compile assets with Laravel Mix
# options: dev, prod
npm run dev

jigsaw-blog-template's People

Contributors

036 avatar adammish avatar ahinkle avatar allmanaj avatar andypa avatar atymic avatar bakerkretzmar avatar cameron-elliott avatar damiani avatar diomed avatar fletch3555 avatar imacrayon avatar intrepidws avatar julienbourdeau avatar matthieumota avatar mattstauffer avatar mishagp avatar vmitchell85 avatar zuzana-kunckova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jigsaw-blog-template's Issues

The Mix manifest does not exist

$ composer create-project tightenco/jigsaw-blog-template
$ cd jigsaw-blog-template
$ vendor/bin/jigsaw build
Building local site
Building files from source...
In helpers.php line 99:

   The Mix manifest does not exist. (View: /tmp/jigsaw-blog-template/source/
   _layouts/master.blade.php) (View: /tmp/jigsaw-blog-template/source/_layouts/
   master.blade.php)

In helpers.php line 99:

   The Mix manifest does not exist. (View: /tmp/jigsaw-blog-template/source/
   _layouts/master.blade.php)

In helpers.php line 99:

   The Mix manifest does not exist.

archive page

hello

could it be possible to have archive page to come along with a blog template?
seems to be only thing that's kinda missing.

could search pick up all pages?

I hoped search works for all pages, but when I look for content of About - there are no results.
how can I include more pages?

build fails with issue with rss blade source template

Tried building the docs template which worked fine, when building the blog template it errors at the build stage for the rss template

In b1bd50064881d5d5fd15ab8102895a60541340af.php line 1:

  syntax error, unexpected 'version' (T_STRING) (View: /home/chris/blog/sourc
  e/_layouts/rss.blade.php) (View: /home/chris/blog/source/_layouts/rss.blade
  .php)

build [--pretty PRETTY] [-c|--cache [CACHE]] [--] [<env>]

vendor/bin/jigsaw init blog

After running this:
vendor/bin/jigsaw init blog
or
vendor/bin/jigsaw init docs

It's showing this:
The 'tightenco\jigsaw-blog-template' preset could not be found.
and
The 'tightenco\jigsaw-docs-template' preset could not be found.

Am I doing something wrong?
Help.

No package-lock.json

This keeps bothering me, so I am sorry I have to say something! Ack!

Anyway, the 'docs' template has a package-lock.json file in the root, but the 'blog'
template does not.
Is that by design or another reason?

https://docs.npmjs.com/files/package-lock.json

"This file is intended to be committed into source repositories, and serves various purposes: ..."

Where is the $posts come from?

In some templates (index.blade.php, category.blade.php, feed.blade.atom) there is a $posts object used. Where is it's value/content come from?

template preview

could you after merging current PR's rebuilt template so it reflects current state of things?

[also, year needs to be upped, if it hasn't been yet]

Blade escapes html generated from markdown extra footnotes

When using footnotes from the extended markdown functionality I notice that footnote html is escaped e.g:

<div class="footnotes">
   <hr />
   <ol>
   <li id="fn:1">
   &lt;p&gt;At the time of this article being written this was freely available from &lt;a href="http://edn.embarcadero.com/article/20841#2HowtoDownloadTurboC"&gt;here&lt;/a&gt;. However it appears that they have put the download behind a sign-up wall - which while admittedly is free means I have mirrored a copy &lt;a href="/files/tc201.zip"&gt;here on Photogabble&lt;/a&gt; for ease of access and for future prosperity if ever the original source goes away for good.&amp;#160;&lt;a href="#fnref1:1" rev="footnote" class="footnote-backref"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
   </li>
 </ol>

Oddly enough none of the other html produced by markdown seems to have been escaped.

Date parsing and quotes

How comes when I have a front-matter field for the date such as:

date: '2016-09-10'

it yields this on build

malachi@pulsar toy $ ./vendor/bin/jigsaw build  

Building local site 
Building files from source...


In 94fa008e79391fab6bca27b2dbfc9ea9b1cebe49.php line 3:
                                                                                                                                                                                                                                    
  Call to a member function format() on bool (View: /home/malachi/code/web/toy/source/_components/post-preview-inline.blade.php) (View: /home/malachi/code/web/toy/source/_components/post-previ  
  ew-inline.blade.php)                                                                                                                                                                                                              
                                                                                                                                                                                                                                    

In 94fa008e79391fab6bca27b2dbfc9ea9b1cebe49.php line 3:
                                                                                                                                                   
  Call to a member function format() on bool (View: /home/malachi/code/web/toy/source/_components/post-preview-inline.blade.php)  
                                                                                                                                                   

In 94fa008e79391fab6bca27b2dbfc9ea9b1cebe49.php line 3:
                                              
  Call to a member function format() on bool  
                                              

build [--pretty PRETTY] [-c|--cache [CACHE]] [--] [<env>]

yet

date: 2016-09-10

works. My understanding of YAML is that both should be treated as string, yet with quote's it seems to be parsed as bool from the error.

jigsaw-blog-template 1.2.0 is broken with jigsaw 1.3.34

jigsaw init blog terminates with this error:

> npm run local
npm ERR! missing script: local

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-02-07T00_44_50_430Z-debug.log

There was an error running the command 'npm run local'

This likely stems from the local npm script being removed in this change.

vendor/tightenco/jigsaw/stubs/mix/package.json:        "dev": "npm run local",
vendor/tightenco/jigsaw/stubs/mix/package.json:        "watch": "npm run local -- --watch"
vendor/tightenco/jigsaw/src/Scaffold/DefaultInstaller.php:        'npm run local',

The easiest way to address this is probably to create a local script that invokes the same command as the dev script: mix watch.

source/assets/js/main.js

Maybe I am a little confused, but should this file be in the repo? Isn't Mix creating it?

Same question about source/assets/mix-manifest.json

Replace Highlighter with Prism?

See this blog post. I suspect Prism may be smaller in terms of size impact on frontend builds, but it'd be worth experimenting to confirm that. I also suspect the functionality of Prism is at least equivalent, if not more robust.

highlight.js 9.x is no longer supported

When initializing a fresh blog using the instructions here, the console output from the resulting npm install invocation includes these lines.

> npm install
npm WARN deprecated [email protected]: Support has ended for 9.x series. Upgrade to @latest
> [email protected] postinstall /app/node_modules/highlight.js
> node deprecated.js

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  Verion 9 of Highlight.js has reached EOL.  It will no longer
  be supported or receive security updates in the future.
  Please upgrade to version 10 or encourage your indirect
  dependencies to do so.

  For more info:
  
  https://github.com/highlightjs/highlight.js/issues/2877
  https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_UPGRADE.md

The highlight.js guides for upgrading and breaking changes don't appear to indicate that the usage of highlight.js in this repository is affected by any BC-breaking changes.

$ git grep highlight
package.json:        "highlight.js": "^10.5.0",
readme.md:- Syntax highlighting using [highlight.js](https://highlightjs.org/)
source/_assets/js/main.js:import hljs from 'highlight.js/lib/highlight';
source/_assets/js/main.js:// Syntax highlighting
source/_assets/js/main.js:hljs.registerLanguage('bash', require('highlight.js/lib/languages/bash'));
source/_assets/js/main.js:hljs.registerLanguage('css', require('highlight.js/lib/languages/css'));
source/_assets/js/main.js:hljs.registerLanguage('html', require('highlight.js/lib/languages/xml'));
source/_assets/js/main.js:hljs.registerLanguage('javascript', require('highlight.js/lib/languages/javascript'));
source/_assets/js/main.js:hljs.registerLanguage('json', require('highlight.js/lib/languages/json'));
source/_assets/js/main.js:hljs.registerLanguage('markdown', require('highlight.js/lib/languages/markdown'));
source/_assets/js/main.js:hljs.registerLanguage('php', require('highlight.js/lib/languages/php'));
source/_assets/js/main.js:hljs.registerLanguage('scss', require('highlight.js/lib/languages/scss'));
source/_assets/js/main.js:hljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml'));
source/_assets/js/main.js:    hljs.highlightBlock(block);
source/_assets/sass/main.scss:// Code syntax highlighting,
source/_assets/sass/main.scss:// powered by https://highlightjs.org
source/_assets/sass/main.scss:@import '~highlight.js/styles/a11y-light.css';
source/_posts/customizing-your-site.md:// Code syntax highlighting,
source/_posts/customizing-your-site.md:// https://highlightjs.org
source/_posts/customizing-your-site.md:@import '~highlightjs/styles/default';

Disqus Comments

Hey!

I was wondering you you'd be open adding disqus comments to the blog template?
I wrote a post on how to do it here but I think it would be a good feature to have integrated.

Let me know, would be happy to PR.

Difference in NPM local and production css compilation of mailchimp

This code in _mailchimp.scss:

    div.mc-field-group {
        > div.mce_inline_error {
            @apply .bg-transparent;
            @apply .float-left;
            @apply .font-semibold;
            @apply .p-0;
            @apply .text-grey-darker;

            clear: both;
        }
    }

It compiles fine on npm run dev and resulting css file has above classes:
image
image

But on npm run production, resulting css does not have above classes, hence it uses default styling from mailchimp and does not go with the rest of the design.
image
image

Any idea why could it be happening?

Thanks.

Translate Date

Hello guys,

currently i am translating the template in german. But I am unable to translate the Dates for blog posts. I want to use german months. Any idea how to achieve it?

axios 0.18.1 contains a security vulnerability

When initializing a fresh blog using the instructions here, the console output from the resulting npm install invocation includes these lines.

npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1.
For more information, see https://github.com/axios/axios/pull/3410
found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

Running npm audit as suggested produces this console output.

=== npm audit security report ===                        
                                                                                
# Run  npm install --save-dev [email protected]  to resolve 1 vulnerability
                                                                                
  High            Server-Side Request Forgery                                   
                                                                                
  Package         axios                                                         
                                                                                
  Dependency of   axios [dev]                                                   
                                                                                
  Path            axios                                                         
                                                                                
  More info       https://npmjs.com/advisories/1594                             
                                                                                


found 1 high severity vulnerability in 1239 scanned packages
  run `npm audit fix` to fix 1 of them.

Running npm audit fix as suggested produces this console output.

+ [email protected]
added 1 package from 3 contributors, removed 1 package and updated 1 package in 5.354s

53 packages are looking for funding
  run `npm fund` for details

fixed 1 of 1 vulnerability in 1239 scanned packages

The axios upgrade guide doesn't mention any BC-breaking changes for 0.18.x or beyond. axios is only used in one place in this codebase (for search) and in a relatively-simple fashion that shouldn't be impacted.

Incomplete (stripped) 1st production build

I found a weird bug where the 1st production build with npm run production will produce incomplete build/css/main.css. However subsequent builds will correct the issue itself.

I am trying with the sample jigsaw blog $ ./vendor/bin/jigsaw init blog. I deleted the build/ folder and run npm run production for the 1st time
image
Notice the 11.4kb main.css

This is what I get in next build with npm run production
image
Here we have 12.4kb main.css

Here is the screenshot of code compare in VS code of these 2 different main.css
image

My working environment:

OS: Window 10
node version: 10.15.3
npm version: 6.8.0
Laravel mix version: 4.0.14

class is too close

can someone please check source of this template in Firefox's source preview.

as you can see here:

<a href="http://jigsaw-blog-staging.tighten.co/blog/getting-started" title="Read - Getting Started"class="uppercase tracking-wide mb-4">

class is too close to " and that's a minor bug.
might be good to fix it - since Firefox shows it as invalid few times in source code.

Default Category Page Possible?

Would it be possible to add a default category page?

If I go to a category url I don't have or haven't created yet I get a No input file specified error.

See https://vincemitchell.me/blog/categories/jigsaw/

So, if I use a new category in my post I have to remember to create a file for that category.

Would it be possible to add capability for a "catch all" or _default.md file maybe?

Hope that makes sense.

@push('meta') doesn't work correctly

Pushing description and og:description to the meta stack doesn't work the way it should -- since there is <meta property="og:description" content="{{ $page->siteDescription }}" /> above, it takes precedence.

Also this should be fixed in the master layout:

-<meta name="description" content="{{ $page->meta_description ?? $page->siteDescription }}">
+<meta name="description" content="{{ $page->description ?? $page->siteDescription }}">

The og:description can be fixed by making this change to the master layout:

-<meta property="og:description" content="{{ $page->siteDescription }}" />
+<meta property="og:description" content="{{ $page->description ?? $page->siteDescription }}" />

And the og:url can be removed from the post layout, since it's the same in the master layout.

I can create a PR fixing this.

However, I'm not sure how the og:type should be overwritten:
master:

<meta property="og:type" content="website" />

post:

<meta property="og:type" content="article" />

The type should probably come from some $page property or method.

Strange Build problem

I have a wordpress blog I am trying to move over to jigsaw blog template. I have a large amount of markdown files (~200) I am trying to bring in. Doing a few files at a time is fine, but at a certain point I get the error (below) that I have no clue how to fix. Once this happens I have to re-init the template to get back. Pretty much stuck on this. I can't seem to tie it to something in the file(s). Any help is appreciate (love your work here). DJK

(base) Apple:Deanonsoftware apple$ ./vendor/bin/jigsaw build

Building local site
Building files from source...

PHP Notice: A non well formed numeric value encountered in /Users/apple/Deanonsoftware/cache/98aae06b1d504cdda44e9b5acdb9dc2a31fd50ae.php on line 15
PHP Notice: A non well formed numeric value encountered in /Users/apple/Deanonsoftware/cache/42ffd2601059e747fee5c0b2cb663d37812f0146.php on line 5
PHP Notice: A non well formed numeric value encountered in /Users/apple/Deanonsoftware/cache/42ffd2601059e747fee5c0b2cb663d37812f0146.php on line 6

In Factory.php line 161:

None of the views in the given array exist. (View: /Users/apple/Deanonsoftw
are/source/_components/post-as-rss-item.blade.php) (View: /Users/apple/Dean
onsoftware/source/_components/post-as-rss-item.blade.php)

In Factory.php line 161:

None of the views in the given array exist. (View: /Users/apple/Deanonsoftw
are/source/_components/post-as-rss-item.blade.php)

In Factory.php line 161:

None of the views in the given array exist.

build [--pretty PRETTY] [-c|--cache [CACHE]] [--] []

(base) Apple:Deanonsoftware apple$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.