Thoughts, stories and ideas.

고스트 블로그 셋팅

Theme

이미지에 Alt 문구 추가하기

post.hbs

<script type="text/javascript">
         $(document).ready(function(){
             var contentM = $('.kg-card-markdown p');
             contentM.each(function(){
                 console.log()

                 if (!$(this).find('img').length == 1)
                 {
                     return
                 } else {
                     var alt = $(this).find('img').attr('alt');
                     $(this).append('<div class="alt-text" style="text-align:center    ;text-align:center;color:#666;font-style:italic;font-size:smaller">'+alt+'</div>') 28                 }


             });
         });
     </script>

Add Syntax Highlighting to Ghost Blog

There's a few different syntax highlighting libraries available such as highlight.js, Rainbow, and Prism.js. Prism.js is the most robust and well documented option available

Adding Prism.js to your blog

There's a handy tool available on the official Prism.js website which allows you to customize Prism.js to your specific requirements.

My blog - Bash / C / CSS / HTML / Javascript / JSON / PHP / Python / SQL

Once you've generated the prism.js and prism.cs files, you can now transfer them to your server. You'll want to upload them to the following locations:

content/themes/your-theme/assets/js/prism.js
content/thems/your-theme/assets/css/prism.css

Next you'll need to add the link and script tags to your blog. This can be done via editing the default.hbs file.

content/themes/your-theme/default.hbs

Under the {{!-- Styles --}} section you can add the link tag:

{{!-- Styles --}}
<link rel="stylesheet" type="text/css" href="{{asset "css/prism.css"}}" />

And under the {{!-- JavaScript files --}} section you can add the script tag:

{{!-- JavaScript files --}}
<script type="text/javascript" src="{{asset "js/prism.js"}}"></script>

Example

#include 
int main()
{
   printf("Hello, World!");
   return 0;
}
Sub revert_Pivot_Table()

    Dim rngAll As Range                                 'A열 데이터 영역을 넣을 개체변수
    Dim rngC As Range                                  '각 셀(C)ell을 넣을 변수
    Dim r As Long                                          '행(r)ow을 늘려갈 별수
    Dim j As Integer                                        '반복구문에 사용할 변수
    Dim varTop As Variant                               '제목행 넣을 배열변수
    Dim rngA As Range                                   '각 TYPE별 영역(A)rea를 넣을 변수     
    
    With Application
        .ScreenUpdating = False

플러그인

: How to use?
https://prismjs.com/plugins/line-numbers/

환경셋팅

DISCUS 제거하기

{{!-- Styles --}}
<link rel="stylesheet" type="text/css" href="{{asset "css/prism.css"}}" />
{{!-- JavaScript files --}}
<script type="text/javascript" src="{{asset "js/prism.js"}}"></script>