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

Warn about missing templates instead of silently dropping content #3171

Open
lpar opened this issue Mar 12, 2017 · 8 comments
Labels

Comments

@lpar
Copy link

@lpar lpar commented Mar 12, 2017

Followup to discussion on forum.

If files include a layout = value in their frontmatter, and there is no matching template, they are silently ignored.

Instead, some sort of error should be generated, or at least a warning. Something along the lines of:

No template matching layout 'foo' for file/name/here.md

This would have saved me quite a bit of debugging time.

@stale

This comment has been minimized.

Copy link

@stale stale bot commented Dec 6, 2017

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Dec 6, 2017
@vassudanagunta

This comment has been minimized.

Copy link
Contributor

@vassudanagunta vassudanagunta commented Dec 7, 2017

#3514 would be a good place for this.

@stale

This comment has been minimized.

Copy link

@stale stale bot commented Mar 7, 2018

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Mar 7, 2018
@bep bep added the Keep label Mar 7, 2018
@stale stale bot removed the Stale label Mar 7, 2018
@kaushalmodi

This comment has been minimized.

Copy link
Member

@kaushalmodi kaushalmodi commented Mar 7, 2018

I think solving this issue is critical for better site debug. Please don't let this just drop off.

@bep

This comment has been minimized.

Copy link
Member

@bep bep commented Mar 7, 2018

I think this would be more useful in this area: #4481 -- I'm not totally sure about this one.

@kaushalmodi

This comment has been minimized.

Copy link
Member

@kaushalmodi kaushalmodi commented Mar 7, 2018

Solution to that issue would be even better! May be that trace shows a warning that as the layout specified in front matter does not exist, Hugo is using the default available as per lookup order.

@sarathsp06

This comment has been minimized.

Copy link

@sarathsp06 sarathsp06 commented May 8, 2019

I am writing a blog now , it just disappeared from the site . No logs suggesting something went wrong.
Only the content of the markdown is changed

@sarathsp06

This comment has been minimized.

Copy link

@sarathsp06 sarathsp06 commented May 8, 2019

Following is the markdown

+++
title= "JSON formatting in VIM"
date= 2019-05-08T18:52:44+01:00
toc= true
tags= [
"programming",
"technology",
]
+++

Quick read

To format JSON in vim follow the following steps

  1. Install gojson
  2. In vim open JSON file and after clicking esc type :%!gojson to format the current buffer.
  3. To save the buffer type :w as usual

How it works

A little Introduction

Everybody knows how pipes work at the command prompt. Text originates from some source, is processed via one or more tools that accepts input through standard input each pass its output through pipes


For example,The following command can be used to list top 10 files in the current directory sorted in descending order of the file size

$ find . -type f -exec du -ah {} +  | sort -n -r | head                                                                 
940K	./.git/modules/Hugo/sarathsp06.github.io/objects/pack/pack-2d1b2e11f747e4e44aa7c0fbfa39633380c044d8.pack
924K	./.git/modules/Hugo/public/sarathsp06.github.io/objects/pack/pack-2d1b2e11f747e4e44aa7c0fbfa39633380c044d8.pack
880K	./LaTeX/fonts/segoeuib.ttf
836K	./LaTeX/img/languages_muted.pdf
408K	./.git/modules/Hugo/themes/hermit/objects/pack/pack-f2158a521b5130023db80ce574d7e402caf1817f.pack
320K	./Hugo/themes/KeepIt/images/home_post_mode.jpg
268K	./Hugo/static/logo.png
268K	./Hugo/static/gopher.png
268K	./Hugo/public/logo.png
268K	./Hugo/public/gopher.png




VI takes this same paradigm of pipes and filters and wraps it in a editor user interface in which the pipe is applied to editing buffer both as a source and as a destination. A VI pipe is thus can alter the buffer using standard Unix filters that instantly become a part of editor toolbox. This is an extremely elegant idea. The ability to pass nearly arbitrary chunks of text through any UNIX filter adds incredible flexibility at no "additional cost" in size or performance of the editor.



That was a stoke in genius in design on vi. And still remains one of the most advanced features vi(and by extension VIM) has. Which, unfortunately, few people understand and use to the full extent.


In VI/VIM following can be used to pipe the buffer to command

  :%!command




GOJSON is a command line tool to handle JSON data. It accepts input as standard input and writes formatted json to standard out so in VIM

following can be used to format JSON

:$!gojson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.