我将一系列博客文章(通过 xml)导入 WordPress,并且删除了 YouTube 嵌入标签。帖子中的 YouTube 网址无法识别。相反,只留下 url 的文本。可能与完整嵌入标签相反。我正在尝试恢复嵌入代码,以便可以看到它。
XML 导入中值得注意的另一个事实是出现 [EMBLED CONTENT] 而不是 url,即视频...
我是新手,所以很容易.我创建了一个博客.我已成功实施评论并将其附加到每个帖子.现在......我想在侧边栏中显示所有帖子中最新评论的列表.我认为这里涉及两件事,一个是对comment_controller.rb的更新,然后是来自实际页面的调用.这是注释控制器代码.
class CommentsController < ApplicationController
def create
@post = Post.find(params[:post_id])
@comment = @post.comments.create!(params[:comment])
respond_to do |format|
format.html { redirect_to @post}
format.js
end
end
end
Run Code Online (Sandbox Code Playgroud) 这是一个创意之一:-)
我将定期收到数百个新网址的列表,并希望了解它们是否链接到博客 - 准确度在80%到95%之间就足够了.
显然我需要分析页面的HTML - 但你究竟会如何处理这个问题(例如元标记,结构分析,模式匹配,机器学习......)?
我的 index.liquid 中有以下代码块
<div class="news-notable">
<h2>New & Notable</h2>
<ul>
{% for article in blogs[blog.news].articles limit: 4 %}
<li><a href="{{ article.url }}">{{ article.title }}</a><br />
<span class="date">{{ article.published_at | date: '%b %d, %Y' }}</span></li>
{% endfor %}
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
在 h2 之后没有任何输出。我也试过只使用
{% for article in blogs.articles %}
Run Code Online (Sandbox Code Playgroud)
这也不起作用。在此先感谢您的帮助!
我使用draft-js 在Web 应用程序中显示编辑器。但是我在草稿编辑器中显示文件上传选项时遇到问题。
您可以在此处查看演示https://jpuri.github.io/react-draft-wysiwyg/#/
import React, { Component } from 'react';
import logo from './logo.svg';
import { EditorState } from 'draft-js';
import { Editor } from 'react-draft-wysiwyg';
import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';
class App extends Component {
constructor(props) {
super(props);
this.state = {
editorState: EditorState.createEmpty(),
};
}
onEditorStateChange: Function = (editorState) => {
this.setState({
editorState,
});
};
render() {
const { editorState } = this.state;
return (
<div className="App">
<header className="App-header">
<Editor
editorState={editorState}
toolbarClassName="toolbarClassName"
wrapperClassName="wrapperClassName"
editorClassName="editorClassName"
onEditorStateChange={this.onEditorStateChange}
toolbar={{
inline: …Run Code Online (Sandbox Code Playgroud) 我有一个带有查看帖子链接的索引路由。在帖子页面上,帖子都显示了标题链接,但是今天我在写另一篇博文时使用了 netflify CMS 我注意到现在帖子页面显示了指向 localhost:8000/blog/blog/{the-post- 的各个帖子链接姓名}。如果我从 url 中删除了“博客”部分之一,相关的帖子就会正确加载。我只是不明白为什么会发生这种情况,因为该网站之前运行良好。
该问题似乎与 {node.fields.slug} 错误链接有关
任何帮助表示赞赏!
盖茨比配置
module.exports = {
siteMetadata: {
// edit below
title: `Front-end Developer`,
author: `Alex Virdee`,
description: `A starter personal blog with styled components, dark mode, and Netlify CMS.`,
siteUrl: `https://hungry-bassi-27b875.netlify.app/`,
social: {
twitter: `alex_virdee`,
},
},
plugins: [
`gatsby-plugin-netlify-cms`,
`gatsby-plugin-styled-components`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
`gatsby-plugin-offline`,
`gatsby-plugin-react-helmet`,
`gatsby-plugin-feed-mdx`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/content/blog`,
name: `blog`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/content/assets`,
name: `assets`,
},
},
{ …Run Code Online (Sandbox Code Playgroud) 我正在尝试用 Hugo 建立一个博客,只要我使用 Markdown,它基本上就可以正常工作。但由于我在存储库中还有一些带有 antora 的其他网站内容(文档),所以我想用 asciidoc 编写所有文本。但当我尝试从 adoc 文件生成网站时,我总是遇到这个错误。Markdown 可以工作,但 Asciidoc 给出了这个例外:
\nsebastian@kobol:~/work/repos/sommerfeld-io/website/blog$ hugo\nStart building sites \xe2\x80\xa6 \nhugo v0.92.1-85E2E862 linux/amd64 BuildDate=2022-01-27T11:44:41Z VendorInfo=gohugoio\nError: Error building site: "/home/sebastian/work/repos/sommerfeld-io/website/blog/content/posts/my-second-post.adoc:1:1": access denied: "asciidoctor" is not whitelisted in policy "security.exec.allow"; the current security configuration is:\n\n[security]\n enableInlineShortcodes = false\n [security.exec]\n allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']\n osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']\n\n [security.funcs]\n getenv = ['^HUGO_']\n\n [security.http]\n methods = ['(?i)GET|POST']\n urls = ['.*']\n\n\nTotal in 40 ms\nRun Code Online (Sandbox Code Playgroud)\n任何人都可以给我一个关于如何允许从hugo builds 访问asciidoctor 的提示吗?
\n我正在寻找一些博客网站,在那里我可以直接在我的出版物中粘贴c ++代码示例,并查看所有对齐和颜色的代码,就像我在pastie.org上看到的那样.
我需要自动制作所有这些东西,因为我不知道HTML并且不能自己制作代码更改.
我有一个网站和一个谷歌博客网站.我想在我的网站主页上添加一个部分,显示3或4个最近的博客帖子(帖子标题和帖子的前100-200个单词).
是否有可以执行此操作的小部件或有关如何设置的任何建议?
谢谢!
我有一个博客博客,但是我对他们的API有点迷茫。我想知道是否可以创建一个列出我博客的所有帖子的页面。
我在互联网上找到了一些答案,但是大多数答案不再起作用了:(
我还有另一个问题:可以在不使用JavaScript的情况下使用数据库?我可能是错的,但是我认为大多数小部件都使用AJAX(它调用一些JSON来获取所有信息并将其显示在JS中)。
谢谢 !