No description
Find a file
Daniel Uber 18a2a98b7a
Simplify logic around generated article description (#13965)
* Simplify logic around generated article description

@citizen428 helpfully pointed out ActiveSupport's String#truncate
method, and I had read the processed_description method body
immediately before and knew it could benefit from using truncate.

When the body text is present, if it's long, truncate to 100
characters (with trailing ellipsis as needed), removing newlines.

When the body text is absent, populate with a generic "post by user"
message.

* Change magic description length to match the original behavior

Since we were previously slicing [0..100] we would get 101 characters, and then
appending three dots makes for 104 total.

There is a longish description passed in the articles api request test
that shows "part of the body as a description" that failed to match
with the first pass.
2021-06-11 15:24:09 -05:00
.buildkite
.gems
.github Set husky explicilty to version 4.x. (#13514) 2021-04-26 13:26:12 -04:00
.vscode
.yarn/releases
app Simplify logic around generated article description (#13965) 2021-06-11 15:24:09 -05:00
bin Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
config Create DiscussionLocks (#13905) 2021-06-10 11:04:33 -04:00
cypress Remove defer attributes from inline scripts - gist embeds (#13407) 2021-06-11 08:22:50 +01:00
datadog Declare DD_VERSION in prerun.sh 2nd try (#13258) 2021-04-05 17:10:46 -04:00
db Create DiscussionLocks (#13905) 2021-06-10 11:04:33 -04:00
docs API: Remove Admin Config endpoint (#13934) 2021-06-08 09:43:51 +02:00
lib Removing Settings::General.email_addresses (#13958) 2021-06-11 12:34:34 +03:00
log
public change Dev_favicon to Forem_favicon (#13872) 2021-06-03 18:07:58 -05:00
scripts Switch references to Forem master branch to main (#12325) 2021-04-16 11:51:06 -05:00
spec 15 minute fix: Shorten long titles from feed items if needed (#13961) 2021-06-11 12:51:51 -05:00
vendor Bump ddtrace from 0.49.0 to 0.50.0 (#13938) 2021-06-10 14:12:28 -04:00
.codeclimate.yml
.dockerignore
.editorconfig
.env_sample When AWS_ID is the placeholder value, act as though AWS not setup (#13850) 2021-05-26 13:54:16 -05:00
.erb-lint.yml
.eslintignore
.eslintrc.js
.gitattributes
.gitdocs.js
.gitignore Rename SiteConfig to Settings::General (#13573) 2021-05-21 14:45:37 +02:00
.gitpod.dockerfile Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
.gitpod.yml Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
.nvmrc
.postcssrc.yml
.prettierignore
.prettierrc.json
.rspec
.rubocop.yml Bump rubocop from 1.15.0 to 1.16.0 (#13894) 2021-06-02 09:11:38 -04:00
.rubocop_todo.yml
.ruby-version
.simplecov
.slugignore
.travis.yml [Travis] Only cache vendor/bundle and node_modules (#13758) 2021-05-14 10:26:10 -04:00
.yardopts
.yarnclean Remove assets folder from .yarnclean (#13869) 2021-05-27 10:39:59 -04:00
.yarnrc
babel.config.js
CODE_OF_CONDUCT.md
config.ru
container-compose.yml Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
Containerfile Update Bundler version (#13278) 2021-04-06 12:44:53 -05:00
CONTRIBUTING.md
cypress.dev.json
cypress.json Disable Cypress's video feature (#13638) 2021-05-03 17:43:19 -04:00
docker-compose.yml Update docker-compose.yml file to permit login (#13792) 2021-05-24 20:03:36 -05:00
Dockerfile
empty-module.js
Gemfile Bump ddtrace from 0.49.0 to 0.50.0 (#13938) 2021-06-10 14:12:28 -04:00
Gemfile.lock Bump ddtrace from 0.49.0 to 0.50.0 (#13938) 2021-06-10 14:12:28 -04:00
Guardfile
jest.config.js Get a11y lint script paths from rails helper (#13912) 2021-06-10 09:25:29 +01:00
jsconfig.json
LICENSE.md
package.json Bump @testing-library/dom from 7.31.0 to 7.31.2 (#13929) 2021-06-08 16:16:44 +01:00
postcss.config.js
Procfile
Procfile.dev
Procfile.dev-hot
Rakefile
README.md Remove Vaidehi from Forem Core Team (#13769) 2021-05-14 12:31:31 -07:00
release-tasks.sh Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
SECURITY.md
svgo.config.js
testSetup.js
yarn.lock Bump ssri from 6.0.1 to 6.0.2 (#13954) 2021-06-10 18:07:25 +02:00


Forem 🌱

For Empowering Community

ruby version rails version Travis Status for forem/forem Code Climate maintainability Code Climate technical debt CodeTriage badge Dependabot Badge GitPod badge Netlify badge GitHub code size in bytes GitHub commit activity GitHub issues ready for dev Honeybadger badge Knapsack Pro Parallel CI builds for dev.to

Welcome to the Forem codebase, the platform that powers dev.to. We are so excited to have you. With your help, we can build out Forems usability, scalability, and stability to better serve our communities.

What is Forem?

Forem is open source software for building communities. Communities for your peers, customers, fanbases, families, friends, and any other time and space where people need to come together to be part of a collective. See our announcement post for a high-level overview of what Forem is.

dev.to (or just DEV) is hosted by Forem. It is a community of software developers who write articles, take part in discussions, and build their professional profiles. We value supportive and constructive dialogue in the pursuit of great code and career growth for all members. The ecosystem spans from beginner to advanced developers, and all are welcome to find their place within our community. ❤️

Table of Contents

Community

For a place to have open discussions on features, voice your ideas, or get help with general questions please visit our community at forem.dev.

Contributing

We encourage you to contribute to Forem! Please check out the Contributing to Forem guide for guidelines about how to proceed.

Getting Started

This section provides a high-level quick start guide. If you're looking for the installation guide, you'll want to refer to our complete Developer Documentation.

We run on a Rails backend, and we are currently transitioning to a Preact-first frontend.

A more complete overview of our stack is available in our docs.

Prerequisites

Local

Containers

Linux

OS X

Installation Documentation

View Full Installation Documentation.

Developer Documentation

Check out our dedicated docs page for more technical documentation.

Core team

Vulnerability disclosure

Forem is the open source software which powers DEV.

We welcome security research on DEV under the terms of our vulnerability disclosure policy.

Acknowledgments

Thank you to the Twemoji project for the usage of their emojis.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please see the LICENSE file in our repository for the full text.

Like many open source projects, we require that contributors provide us with a Contributor License Agreement (CLA). By submitting code to the Forem project, you are granting us a right to use that code under the terms of the CLA.

Our version of the CLA was adapted from the Microsoft Contributor License Agreement, which they generously made available to the public domain under Creative Commons CC0 1.0 Universal.

Any questions, please refer to our license FAQ doc or email yo@dev.to.


Sloan, the sloth mascot
Happy Coding ❤️

⬆ Back to Top