I never dreamed that when I said goodbye to Jekyll and Hugo, Astro would accept me the most.Just like open hands, will never say no to you…But that’s not the point. The point is that I’ve finally inserted a Disqus comment into this Astro-air-blog, and I’m so happy!

No more nonsense, on teaching:

The following three diagrams represent the process.
Because we are using the Astro-air-blog theme background
  • First we find the blog file: src/MarkdownPost.astro
  • And find the following code: ''''
           <a href>
            {tag}
           </a>
);
})
}
       </div>
      </div>
     </div>
     &lt;slot /&gt;
     <div>
      <div>
       <div> 
< img SRC = "https://github.com/tqgx/tqgx/blob/main/TQGX/copyright.png?raw=true" Alt = "my pictures" width = "160" >
<div><p> Thank you for reading.Welcome to share tqgx blog (Tqgx.github.io) articles, references and reprints please indicate the URL and comply with:< a href = "https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh_TW" target = "_blank" > creative Commons attribution - noncommercial - ban as 4.0International </a> License terms.Please write to us for commercial use.
       </div>
      </div>
     </div>
    </article>
   </section>
  &lt;/main&gt;
  <footer />
  &lt;script is:inline&gt;
   var script = document.createElement("script");
   script.src = "/static/js/initPost.js";
   document.head.appendChild(script);
  &lt;/script&gt;
 &lt;/body&gt;
&lt;/html&gt;
To embed the Disqus message board in the above code, you can follow these steps:
"Before the <div> tag, add the following code:
![|inline](https://github.com/tqgx/tqgx/blob/main/TQGX/dis1.png?raw=true)
HTML
<div></div>
Use code with caution. Learn more
At &lt;script is:inline&gt; Before the label, add the following code:
` ` `
` ` ` ` ` `
HTML
&lt;script&gt;
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://{YOUR_DISQUS_SHORTNAME}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
}) ();
&lt;/script&gt;
Use code with caution. Learn more
Replace {YOUR_DISQUS_SHORTNAME} with your short name on Disqus.
After completing the above steps, your code will look like this:
HTML
&lt;slot /&gt;
          <div>
            <div>
              <div></div>
              <div> 
< img SRC = "https://github.com/tqgx/tqgx/blob/main/TQGX/copyright.png?raw=true" Alt = "my pictures" width = "160" >
<div><p> Thank you for reading.Welcome to share tqgx blog (Tqgx.github.io) articles, references and reprints please indicate the URL and comply with:< a href = "https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh_TW" target = "= >" creative Commons attribution - noncommercial - banned international < / a > 4.0 license.Please write to us for commercial use.
              </div>
            </div>
          </div>
        </article>
      </section>
    &lt;/main&gt;
    <footer />
    &lt;script is:inline&gt;
      var script = document.createElement("script");
      script.src = "/static/js/initPost.js";
      document.head.appendChild(script);
    &lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;

Done!

HTML

Leave a comment


Utteranc

Giscus

我的圖片

   Thanks for your reading. You are welcome to share articles of TQGX's Blog (tqgx.github.io). Please include the original URL when reprinting or citing articles, and abide   CC BY-NC-ND 4.0 license. For commercial use, please write an e-mail to me.