2012-03-22 4 views
1

내 웹 사이트를 방문하면 가장 최근의 기사 (홈 페이지)의 제목이 <pre> 태그로 묶여 반복됩니다. 왜 이런 일이 일어나는지 전혀 모른다. 여기 내 게시물에 임의의 태그를 추가하는 Github 페이지

가 표시되고있는 게시물입니다 :

--- 
layout: default 
--- 

Stop distributing .doc files 
---------------------------- 
Monday March 19th, 2012 

`.doc` started as a file format used by many operating systems and used to store only plain-text. In the 90's, Microsoft decided to use the extension for Word -- their new word processor. Not only did they decide to use the extension, but they also broke the standard by using a proprietary format, instead of the plain-text most people were used to. Despite the `.doc` extension being more than **10 years old** and the fact that most documents formatted this way render horribly in operating systems other than Windows, I still regularly receive documents in this format. Stop it. 

However aggravating the above paragraph is, this article isn't solely targeted at the `.doc` extension -- it is a public plea for people to stop distributing application specific documents and to start distrubting all documents in `.pdf`. 

Yesterday I received an email from an engineering society I'm a part of. They were notifying all members of the upcoming annual general meeting that is taking place next week. I immediately lost interest in the email when I saw that their meeting schedule and their nomination form were both in `.docx` format. I don't like being forced to download the file, minimize my browser, launch an Office application (in my case, LibreOffice) and then read the content. Had it been distributed in `.pdf`, Chrome would have immediately opened a new tab for me displaying the document and giving me options to save, zoom or print it. I'm sure Firefox, Opera and (maybe) Internet Explorer have similar features. 

We are increasingly collaborating on the web, and the need for bulky desktop applications are almost gone with the wind. Had I not had an office application on my computer (which could have been possible seeing as I do most of my documentation and report with LaTeX), I would have had an extra step before viewing the content that was sent to me. It's not like it is difficult either. All major office applications I know of allow easy exporting to `.pdf` file format and LibreOffice also allows you to save a hybrid `.pdf` and `.odt` together in one file. This allows you to distribute the PDF as is and also open it for editing. 

There is virtually no need to distribute documents in any format, proprietary or not, other than PDF. Don't make your users work and fiddle with your flatform-specific or application-dependent documents. 

을 그리고 여기 내 기본 레이아웃입니다 (관련 부분은, 당신은 다른 어떤 소스를 볼 수 있습니다) : 당신 같은

<div id="right-side"> 

      {{ content }} 

      <div id="footer"> 
       <p> 
        &copy; {{ site.author.name }} 2012 with help from 
        <a href="http://jekyllbootstrap.com" target="_blank">Jekyll Bootstrap</a> 
       </p> 
      </div> 
     </div> 

이 레이아웃은 right-side div에있는 마크 다운 파일의 내용을 간단히 덤프합니다. 내 사이트의 다른 페이지/게시물을 방문하면 해당 페이지는 작동하지만 홈페이지는 표시되지 않습니다 (같은 표제어 형식이며 같은 레이아웃을 사용하고 있음에도 불구하고).

아이디어가 있으십니까?

+0

나는 그것을 볼 수 없습니까? (이 페이지 [http://maxmackie.com/2012/03/19/Stop-distributing-.doc-files/]입니까?) – huon

+0

@dbaupp, http://maxmackie.com/은 잘 작동하지 않습니다. 연결된 페이지는 동일한 기사이지만 올바르게 작동합니다 (홈페이지에 없으므로) – n0pe

답변

2

루프가 your index page에있는 것이 문제입니다. 들여 쓰기는 Liquid에 의해 보존됩니다 (일종의). 텍스트 대체는 첫 줄이 들여 쓰여질 것이지만 나중의 줄은 들여 쓰기되지 않는 리터럴 대체입니다. Liquid가 실행 된 후 index.md (first.content은 이미 HTML 임)의 가격 인하 프로세싱이 발생하므로 들여 쓰기가 코드 블록으로 해석됩니다. 처리에

단계 (이것은 반드시 각 단계에서 그대로 출력되지 않지만 가까운 것)

{% for first in site.posts limit:1 %} 
    {{ first.title }} 
    {{ first.content }} 
{% endfor %} 

액체 index.md 실행 후 :

Stop distributing .doc files 
    <h2>[...]</h2> 

<p>Monday March 19th, 2012</p> 

[...] 

이제 Markdown이 실행되고 들여 쓰기는 처음 두 줄이 코드 블록임을 의미합니다.

<pre><code>Stop Distributing .doc Files 
&lt;h2 id='stop_distributing_doc_files'&gt;Stop distributing .doc files&lt;/h2&gt;</code></pre> 
<p>Monday March 19th, 2012</p> 

for 루프의 요소에 큰 들여 쓰기가 없기 때문에이 문제를 해결할 수 있습니다. 4 개의 공백으로 들여 쓰기하거나 탭이 코드 블록을 만듭니다. 그래서

{% for first in site.posts limit:1 %} 
    {{ first.title }} 
    {{ first.content }} 
{% endfor %} 
+0

정말 고마워요! 이것은 완벽하게 작동했습니다. 너는 날카로운 시선이있어 기스 츠에서 계속 지켜봐야한다. – n0pe

+0

@MaxMackie는 문제가 아닙니다 :) (전에 비슷한 문제를 만났기 때문에 내가 무엇을 찾고 있는지 알았습니다) – huon

+0

@dbaupp 또 다른 해결책은'{{first. 내용 | markdownify}}'? –